Tag Info

New answers tagged

0

Here’s a little example. Suppose you slerp q0 and q1 with a value of t = 0.2 and a value of t = 0.4. This gives you a quaternion s(0.2) and a quaternion s(0.4). Quaternion multiplication also gives us the following: s(0.2) = q0 * inverse(q0) * s(0.2) '——————— K ————————' So we have a value K which, when right-multiplied with q0, gives us ...


0

When Microsoft created the XNA framework (I know you're using Java, but the math is the same), they created a built in method to create a Quaternion from an axis and angle. The method they used (and you can "reflect" their managed code to verify it, see below) is the same as your first snippet: public static Quaternion CreateFromAxisAngle(Vector3 axis, ...


1

I avoid Euler angles in aircraft pitch, roll, yaw orientations because aircraft rotate about thier local axis and trying to resolve this to Euler angles about the world (or global) axis adds uneccesary complication to the code. Instead of 3 Euler angles, I store the current orientation as a matrix or quat and simply modify the matrix/quat depending on input ...


1

You're using vector3.up, vector3.forward and vector3.right to calculate the needed rotations. These axes don't move along with your plane. What you need to do is rotate the plane around its very own up, forward and right vectors. You could do that like this: Matrix rotMat = Matrix.CreateFromQuaternion(model_ROTATION); Quaternion additionalRotation = ...


0

Special thanks mintman from Reddit/r/Unity3D who fixed this issue here (The following is just copied from his original answer) After doing the interpolation, you set your result to a different quaternion: float chronoP; void checkQuatParent () { if (chronoP > 0) { chronoP -= speed * Time.deltaTime; myTrans.parent.rotation *= ...


0

This sounds like a perfect candidate to use coroutines. By using a coroutine, you can keep the amount of (class) state variables to a minimum and you end up with really clean code. Here's an example how this could look like: // duration of the rotation in seconds, can be set via Inspector public float RotationDuration = 0.5f; private bool _isRotating = ...



Top 50 recent answers are included