Archived

This topic is now archived and is closed to further replies.

Directxlovesme

moving an object in a 3D world with DX9

Recommended Posts

Hi everybody. I''m trying to make a small First Person Shooter, but I don''t know how to move my gun similar to with the camera movement. In other words: Does somebody know how to move an X-file/object trough space with DirectX9? I''ve read some things about strange matrices, but I don''t really understand them very well. Isn''t there an easy way, like just giving the coördinates? Thanks a lot.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
myObject.Move(0.0f, 1.0f, 2.0f); // for instance

Share this post


Link to post
Share on other sites
Read a bit more on matrices, it will be clear to you then.

Meanwhile, d3dx helper library contains many matrix-creating functions, for any anti-math-heads, including D3DXMatrixTranslation().

-Nik

Share this post


Link to post
Share on other sites
Thanks for the answers, guys, but the myObject.Move function doesn''t work. I''m using the Microsoft Mesh loading example, so this is my code to move:

Mesh.move(1.0f,1.0f,1.0f);

The compiler doesn''t recognise the command. Am I doing something wrong?

And could you tell me some sites where I can find some good tutorials on matrices for what I am trying to do?

Meanwhile, I try to find some myself.

Thanks.

Share this post


Link to post
Share on other sites