0
\$\begingroup\$

I posted this question in mathematics, but that sight gets flooded with homework problems... 8 views total, most of them me. Plus, I think this question is more geared to game development anyway.

I am making a 3D graphics processor using VB.Net.

I want to do an airplane game.

I want the plane(s) movements to be scalable by time, so that the appearance is the same regardless of how fast the game-loop is running. And so the amount of matrix & trig operations needed per frame is minimized.

Below is a 2D example of what I am trying to achieve.

enter image description here

I'm trying to do eigen-decomposition so a can scale transform A by time:

\$\begin{align} [A]_{t_0} =& [P][U][P^T]\\ [A]_t =& [P][U]^{(\frac{t}{t_0})}[P^T] \end{align}\$

  • I figure out a complex movement (like turning left) using many small iteration steps at the start of the program.
  • Solving for the largest eigen-vector & its value using the power iteration
  • Other stuff to find the other eigen-vector(s) & values (still haven't nailed that down yet)
  • Now, with this transform-decomposition for the turn-left operation for T seconds of game time, I can compute turn-left transforms for any time duration quickly and easily.

Ran into problems fast with a simple translation matrix that does not decompose. Then I saw this.

This guy apparently did it but did not show how. I know it's going to involve complex eigenvalues (if you got things rotating). I'm not sure how to handle those. And it is going to involve separating the translation part, which I also don't know how to do.

Here is 2 examples that I would like to see how to solve:

Simple X translation
\$ \begin{bmatrix} 1 & 0 & 0 & 30 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \$

Rotating and translating
\$ \begin{bmatrix} -4.52E-07 & 0 & -1 & 19.1 \\ 0 & 1 & 0 & 0 \\ 1 & 0 & -4.52E-07 & 19.1 \\ 0 & 0 & 0 & 1 \end{bmatrix} \$

The whole point is to avoid doing hundreds of movement iterations at every game frame. The example shown has an easy solution for scaling by time, rotating around the arc center by x*dt. But, when I start doing combinations of 3D rotations like TURNING-UP while also TURNING-RIGHT while also ROLLING (cork-screwing in circle) it is going to be extremely time consuming figuring how to scale these movements by time.

I want the computer to do all the math.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ This is not the way that games typically approach adjusting their simulation to different time steps. For common types of movement used in games (like basic Newtonian dynamics), there are simpler strategies that don't involve computing eigenvalues or raising matrices to powers. And we typically try to avoid simulating the game in large variable intervals, because it can lead to non-determinism, where two players providing exactly the same inputs get different results, undermining the consistency and fairness of the game. Are you open to trying more tried-and-true methods for stepping your sim? \$\endgroup\$
    – DMGregory
    Mar 12, 2021 at 23:45
  • \$\begingroup\$ Welcome to GDSE. In the future, please post formulas as markdown MathJax code. \$\endgroup\$
    – Pikalek
    Mar 15, 2021 at 4:46
  • \$\begingroup\$ YES more than open. Also I had an epiphany a few days ago. I am already calculating all the transform iterations... What if I save those iterations as an array of transforms. Then for time X(us) or whatever, use transfrom A_arr(X). \$\endgroup\$
    – user148279
    Mar 16, 2021 at 21:58
  • \$\begingroup\$ I'm pretty sure I'm missing something here but why are you generating the plane's rotation as a self-rotation and a translation when you could just generate it as a single rotation applied to both the local space of the plane and a 'world' space where the axis of rotation is the center of the arc? In that case you only have a \$θ\$ value which you can interpolate easily based on time. \$\endgroup\$
    – PentaKon
    Oct 18, 2021 at 13:02

0

You must log in to answer this question.

Browse other questions tagged .