Sign in to follow this  
Malazar

mesh movement

Recommended Posts

Malazar    152
alright, so i can get a mesh to move with: g_pd3dDevice->SetTransform(D3DTS_WORLD,&matTransform ); the trouble is, everything is transformed to the same point in the world, and when you move, everything moves with you. how can i make it so only one mesh moves (i.e. the player's mesh) whilst the rest (such as buildings) remain stationary? cheers, Mal'

Share this post


Link to post
Share on other sites
Palidine    1315
No idea for the syntax in DirectX but in openGL you push a matrix transform, render the object, pop the transform:


for each object
{
glPushMatrix();

//post-multiply the object's own orientation matrix
//render the object

glPopMatrix();
}



You'd likely do something similar in DirectX.

-me

Share this post


Link to post
Share on other sites
Malazar    152
ah ha!

i think i found the answer to my own question. In the line:
g_pd3dDevice->SetTransform(D3DTS_WORLD,&matTransform );

you set the matrix to apply the transform to, in this case "&matTransform", if i'm right, i can just apply that to a different matrix, for example "&matPlayer" for the player's mesh, or "&matBuilding" for a building somewhere on the level.

i certainly hope this is right ^_^

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