Sign in to follow this  
lebasp

[c++ direct3D 9] two .X Mesh transform problem

Recommended Posts

lebasp    122
Hi there. I'm having some issues trying to move only 1 mesh... i know that if you want to "move" a mesh in your program, you should move the whole world using something like D3DXMatrixRotationY(&matEarth, angle); pd3dDevice->MultiplyTransform(D3DTS_WORLD, &matEarth); but in my case i have 2 meshs, one for earth and another one for the sun... and i want to know how could i put the sun in the middle of the screen locked on, and the Earth spinning around it... i already programmed the spin and so.. but the sun moves with the earth together.... uu' cuz what i'm moving is the world.. is there anyway to create one different world for each mesh? or anything that i could do to treat just the movement of one single mesh? ty in advance. leandro.

Share this post


Link to post
Share on other sites
feal87    238
A world matrix is the position/scale/rotation/etc.. of an object inside the world, each object should have a unique world matrix. (If you are using the fixed pipeline, you have to modify the world matrix before each object is drawn)

In your case the world matrix of the sun should be static while the world matrix of the earth should change each frame.

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