Tag Info

New answers tagged

0

Based on the question, assuming that turning to the right is going a negative angle, and going to the left is going a positive angle. Here is a small graphical reminder: To determine what is the difference in the input, you need to constrain the delta to the same range you use: This is the excel formula I used (row 8, with the "old" value in column A ...


0

According to 50%, 30%, 20% proportions, myScore = (numberOfCoins * 0.5) + (numberOfStars * 0.3) + (numberOfLives * 0.2); But if you want lives to be more important you must redefine the proportions; (i.e 30% for coins, 20% for stars, 50% for lives). That could be achieved by just changing the multiplication factor of the numberOfCoins, numberOfStars, ...


1

You don't necessarily need a parabola formula for this. The best way, in my opinion, to do this is to update the velocity of the ball each frame. I don't know how you organized your code, but I assume you have an update function that is executed multiples times per frame. To make the trajectory of a parabola, you simply need to substract a constant to the ...


1

Refactoring is your friend !!! Separate the issues and try to get your code as generic as possible. Separate and factorise the steps of the computing. Keep comments short. • Boilerplate : // ------------------------ var g = 9.81; //Gravitational acceleration var v = 35.9; //Experimantally measured arrow speed var sqrt = Math.sqrt, atan2 = ...


2

EDIT (added short steps): get triangle normal vector v1 (normalized) get reference surface normal vector v2 (normalized) get angle between normals : angle = acos(v1•v2) (where • = 'dot' product ) get slope = Tan(angle) if you need a surface normal here come the simple algoritm : A surface normal for a triangle can be calculated by taking the vector ...


4

I'm using Hooke's Law here as the definition of a spring. () Given the derivatives of position and velocity, are velocity and force respectively, we can construct a differential equation for the stretching of the spring. Which is just a damped harmonic oscillator, and since we already know that only the under-damped case need analysis, we can obtain a ...


1

"Success list" is a term you made up, don't use it. What you want to compute is some kind of score or rating of each player as an estimate of "player power". The difference between a score and a rating is that a score is typically expected to increase with more games played (e.g. the number of knockouts in a boxer's career), while a rating is expected to ...


0

Note the following important identity for augmented isometric affine matrices: where the isometric condition is recognized from: and is the translation in world coordinates of your original transformation. In vector terms, if you think of your original transformation as being then the inverse transformation, to return to World Coordinates is ...


4

You are right in your assumptions of what needs to be done! In physics engines, after a collision was detected but before the collision is resolved (The changing of the objects velocity) there are a few steps which need to be done. One of these steps is what I call decoupling: The process of separating two intersecting objects. This is the stage you are at. ...


0

Use trig to sample it into a triangle strip. As for texturing: a rectangular image UV-mapped to the triangle strip might work, with projective interpolation.


0

In essence, you need to figure out two things. How to properly preform computation with large numbers. How you want and expect attack damage to behave against weaker and strong opponents. 1 You can either user double or a big number library. Doing computations with large numbers (like in clicking / idle games often relies on such big number libraries). ...


3

Sorry everything would look nicer if latex formatting would be possible. Let's consider three gears: G1, G2 and G3. Now each gear has a given radius r1, r2 and r3. The problem is to find the angular velocity for each gear (denoted av1, av2 and av3). From a physics course we know that the tangent velocity v is proportional to the radius: v1 = av1 * r1. ...


0

Simply adjust your vector3s to vector2s. You're 2d not 3d so having no value for y may be your issue. Not 100% til I try it out, but I'm not home.


2

I'm not sure if I understand your question but here goes: I think you want the sprite to wave over an angle back and forth: Not this is pseudocode (as you didn't state the language): t=(t+wavespeed)%TwoPi; a = Sin(t)*amplitude; Position.X=StartPosition.X + Cos(angle) * a; Position.Y=StartPosition.Y + Sin(angle) * a; t controls the waving motion; the ...



Top 50 recent answers are included