Tag Info

Hot answers tagged

4

Normalization The best option would probably be to normalize the data. This can easily be done using the formula: x = a + (X - A) * (b - a) / (B - A) where a and b are the minimum and maximum values for your desired range, respectively; A and B are the minimum and maximum values for your original range, respectively; X is the input value (in your case, ...


2

You are constructing a function from several inputs to meet a desired output. This function should factor the amount of each attribute in conjunction with the importance. Your use of value pairs for such a function also coheres excellently with a documented decision model. I believe that a weighted sum is in order. The weighted sum model takes in each ...


2

There is of course several ways to do this, and the solutions are very much gamedev related. One perspective on a solution comes from game physics. Basically you'd start by clamping all data to the rectangular window, letting the data overlap. Next, you treat each star as having a minimum distance constraint from every other star, so you'd loop through all ...


2

This may not be ideal, but I've found an answer on another Q/A-site. Multiply all AttackerValues (lets call it AttackRating) Multiply DefenderValues [Without DefenseFitness, see top] (lets call it DefenseRating) Divide AttackRating with DefenseRating (lets call it Rating) Divide Rating with DefenseFitness (lets call it RawDifficulty) Raw Difficulty is a ...


2

Here's a function that interpolates between Start and End quadratically by T. float Qerp (float Start, float End, T) { //The quadratic stuff T = 1 - T; T = 1 - (T * T); float Difference = End - Start; return (Start + (Difference * T)); } I.e.: float Elapsed = 0; const float Length = 2.5f; while (true) { Time.timeScale = Qerp ...


2

Like Pieter mentioned, you can use 1D kinetic equation for height, which in your case will come to: h = p + vt + 0.5at^2 where a is the acceleration due to gravity. You can then use the quadratic equation to solve for t. Once you have t, you can use the kinetic equations again to calculate how far the ball has travelled width ways. This would tell you ...


1

If I understand correctly, what you want to compute is the spline's radius of curvature at each point. Then you want to compare that value to an agent's turning radius to determine if the agent will leave the track there. [1] To do this, you need to calculateR(s)as you see here: https://en.wikipedia.org/wiki/Curvature (under "Curvature of plane curves" > ...


1

I'm sorry for answering my own question: I figured it out and it was just a matter of correct visualization. The inside-triangle check only works if the sphere meets the triangle head-on: in other words, the point of tangency between the sphere and the plane occurs exactly at the correct time. In the other case, if the sphere passes by the triangle such that ...


1

@Richard Byron explained well and gave a well-made sample code. I think it's better to add additional information about the basic math. I leaved out the wall collision. Sorry for bad hand writing an drawing.


1

Now I would first suggest you use GLM, but you're using C (according to your tag) so probably not. The best math I suggest in that case is continual use of the sine and cosine functions. My examples will require math.h You will want to first store your camera's position (if you haven't already) float horizontal = cos(pitch) * GetCameraForwardSpeed(); ...



Only top voted, non community-wiki answers of a minimum length are eligible