Sign in to follow this  
cNoob

World rotation in degrees

Recommended Posts

Hi ive been using Direct3D for a while now and i was hoping someone could help me out a little. So heres what i need help with, i've loaded a mesh and in my program i rotate it like this: D3DXMATRIX matWorld; D3DXMatrixRotationY(&matWorld, timeGetTime()/1000.0f); g_pD3DDevice->SetTransform(D3DTS_WORLD, &matWorld); But in my program i want to be able to rotate in degrees so my code will look something like this: D3DXMATRIX matWorld; D3DXMatrixRotationY(&matWorld, /*90 Degrees*/); g_pD3DDevice->SetTransform(D3DTS_WORLD, &matWorld); Any help on this problem would be great.

Share this post


Link to post
Share on other sites
I don't understand the problem... D3DXMatrixRotationY takes an angle argument. You must specify it in radians, not degrees, however. so:

D3DXMatrixRotationY( &matWorld, 90.0f * PI/180.0f );

Am I missing something?

-me

Share this post


Link to post
Share on other sites
No you didn't miss anything that works perfect. Im sorry if i didnt ask my question so good. I just wasnt to sure if i had to specify it in radians. Thanks again.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this