Jump to content
  • Advertisement
Sign in to follow this  
cNoob

World rotation in degrees

This topic is 4480 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!