# Rapsey

Member

84

122 Neutral

• Rank
Member
1. ## Need accurate time stepping

Well I also needed a high precision timer, did some googling and settled to using the glfw library. Since there were a number of issues with using QueryPerformanceCounter. GLFW is an open source library for doing graphics programming. Im not sure exactly how good their timer code is, but its probably quite good since GLFW is a well respected peace of code.
2. ## Need accurate time stepping

You need a high precision counter. Checkout the win32 API function: QueryPerformanceCounter
3. ## yaw+pitch = roll?

Yes there is a Matrix.RotationYawPitchRoll replacing the quaternion with it does not make any change. matPos.Translate( 0.0f, 0.0f, -500.0f ); Switching the parameters in Matrix.Multiply does not help.
4. ## yaw+pitch = roll?

Nope. This is c# and managed directx. Vector3 is a value type (struct) all that new Vector3 does is set x,y,z to 0.
5. ## yaw+pitch = roll?

Oh sorry, I guess I did not explain my problem properly. I know yaw+pitch != roll. What I want to know is, why the above code rotates the camera about the Z axis. Even though roll is always 0. If yaw and pitch are both above 0 (lookAt.X and lookAt.Y) the camera rotates about the all 3 axes. Can someone please explain to me, why that is happening?
6. ## yaw+pitch = roll?

I dont understand why the camera rotates around the Z axis, when both lookAt.X and lookAt.Y are > 0: pos is the change in position, lookAt represents the angles we're rotating by. Matrix matT, matR; Quaternion qR; matT = Matrix.Translation( pos ); matPos = Matrix.Multiply( matT, matPos ); qR = Quaternion.RotationYawPitchRoll( lookAt.X, lookAt.Y, 0 ); matR = Matrix.RotationQuaternion( qR ); matPos = Matrix.Multiply( matR, matPos ); device.Transform.View = Matrix.Invert( matPos ); pos = lookAt = new Vector3();