Jump to content
  • Advertisement
Sign in to follow this  

[mdx] Object Space to World Space

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

Hello, As I will use global vertexbuffer to store various objects before rendering (it will limit the amout of draw calls), I have to transform all my vertex coordonates from object to world space before writing them in the vertexbuffer. I have several questions : 1) If I have a World transformation matrix ready, do I have only to multiply all my 3Dpoint (Vector) with this matrix ? 2) Is there an already writen function that could make this operation : NewVector = OldVector * Matrix 3) As the matrix will be 4*4, I think that my vector should be a 1*4 vector. What will should be the "W" componant of my vector (0 or 1 ?) ? Tx you very much for the help !

Share this post


Link to post
Share on other sites
Advertisement
Will you be writing to this buffer every frame? If so, you are likely to negate any performance gain you get by reducing DP calls by repeatedly locking and unlocking the vertex buffer.

To answer your questions:
1) Yes.
2) Yes, the appropriate overloads should be written for you already (assuming D3DX).
3) It should be 1. You should be able to verify this yourself by working through the matrix multiplications for the pipeline by hand.

Share this post


Link to post
Share on other sites
Tx you for your answers,

These buffers will only be used for static data buffering, so I will only compute the points of the object once.

At first glance I didn't find D3DX fonction in MDX for this purpose, I will look deeply

You raise a good point concerning dynamic buffering of let's say a lot of particuls, will the overhead of the 3dpoint translation from object to world space be that bad for performance ?

Share this post


Link to post
Share on other sites
Quote:

You raise a good point concerning dynamic buffering of let's say a lot of particuls, will the overhead of the 3dpoint translation from object to world space be that bad for performance ?


It won't be nearly as bad as the locking overhead.

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!