Hello everyone,

I'm a racecar engineer developing a 3D software using DirectX. My knowledge is 3D graphic is low but I managed to do some work!

I've got a fix camera and a moving world and basicly what I want to do is to rotate my car on the screen with the mouse. My issue is that I want my two axis of rotation to stay fix view from the screen. I want an Z axis always (0,0,1) and a Y axis always (0,-1,0). The thing is that this two axis are moving with the world and not staying on the same plane than the screen. So what I did:

mZaxis and mYaxis are my two Z and Y axis. xval and yval the two angle of rotation.

Dim rotation As Matrix = Matrix.RotationAxis(mZaxis, xval) * Matrix.RotationAxis(mYaxis, yval)

Dim mZaxisT As Vector4 = Vector3.Transform(mZaxis, rotation)

Dim mYaxisT As Vector4=Vector3.Transform(mYaxis, rotation)

mZaxis.X = mZaxisT.X

mZaxis.Y = mZaxisT.Y

mZaxis.Z = mZaxisT.Z

mYaxis.X = mYaxisT.X

mYaxis.Y = mYaxisT.Y

mYaxis.Z = mYaxisT.Z

This is not working. Any idea or other suggestion to do this

Thank you in advance,


Re: Direct3D 10 Rotation around fix axis


i think if u look at most samples in the DX SDK u will see how this is done.

Most samples use fixed camera and allow to rotate the object using the mouse.

If u use the DXUT framework most of the code u need for this is allready in there Smile