Jump to content
  • Advertisement

Archived

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

wingman20

Meshes

This topic is 6479 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

I''m new to directX and have done no previous game programing. i''ve been trying to figure out how to move a mesh for quite a while. if i have a mesh, how can i use a matrix to move that arround inworld space. please give me some code. thanks

Share this post


Link to post
Share on other sites
Advertisement
im pretty sure that you do your animation with Cinema 4D or whatever program and then you export all the frames into your directX program. Im pretty sure there are functions in directX 8.0 that will load mesh animations in. You dont have to do the rotation math manually

Share this post


Link to post
Share on other sites
im pretty sure that you do your animation with Cinema 4D or whatever program and then you export all the frames into your directX program. Im pretty sure there are functions in directX 8.0 that will load mesh animations in. You dont have to do the rotation math manually

aDasTRa - that thing about moving pillars around. It would actually be easier than what we are doing now. You are just using words to make it sound like more work than it really is
example:
load up the animation program, move the pillar over again, then save it, then export it, then load up the 3d engine then goto the place where there pillar is, then decide what you want to do
or
move the pillar over, save, export, run. I matter of 20 seconds. You dont have to load up the animation program up again (unless you are running an AMD system that dies when you try to do two things at once because of its sucky one-processor), and you don''t have to close it. Besides, what do you think you do when you are working in a level editor anyways?? Im sorry but that though was complete BS.

I agree with you on the fact that doing all of those visibility tests though. But im sure that there is a way to do get around it. When you use Clip Planes, does it just clip the triangles so it don''t have to draw them or does it make it so that it doesn''t have to do the math aswell?




Share this post


Link to post
Share on other sites
Psionic, your wrong.
That''s a animated mesh your talking about and yes that is quite simple.

How EVER he''s talking about, Scaling, Rotating, and Moving the X Y Z coordinates of the mesh.
To do this you have you actually change the World Matrix that the mesh is being rendered in. It''s not too hard but it sure is complex.

I''ve got a 3D world which all works fine except I''m using D3DTS_VIEW and to do all that stuff to one of my mesh''s make''s everything "trail" so i''m currently trying to figure that problem out.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What you need is matrix translation and transformation.You set the world view matrix to the transformed matrix before rendering the mesh. If you have directx 8, I suggest you use the direct3dx library functions.

Example:
D3DXMATRIX m_mattrans,m_matrot,m_mat;

// set matrix to completely untransformed position
D3DXMatrixIdentity(&m_mat);

// rotation is in radians
D3DXMatrixRotationYawPitchRoll(&m_matrot,0,0.5,0);
D3DXMatrixTranslation(&m_mattrans,0,0,1); // move in z direction

// multiply original matrix by rot. and trans.
D3DXMatrixMultiply(&m_mat,&m_mattrans,&m_mat);
D3DXMatrixMultiply(&m_mat,&m_matrot,&m_mat);

// set world view
d3dDevice->SetTransform( D3DTS_WORLD, &m_mat );
mesh->render();

Share this post


Link to post
Share on other sites
thanks for your reply, but if i have two meshes, for example a mesh for a character''s body and one for his/her arm and i only want to move the arm how can i do that?

thanks

Share this post


Link to post
Share on other sites
In that case have 1 Mesh with 2 Frames in it.

1st frame is just standing still, 2nd frame is whereever you want it. It''s not wise to "animate" body parts by hard code.

To do this use something like 3D Studio Max, or Maya, or Lightwave, or Truespace even.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you use the CD3DFILE class, there are functions that alow you to handle individual frames. As was said, you probably want to get a pre-animated model exported to the x format, then you run the animation from there.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!