Jump to content
  • Advertisement

Archived

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

Mr Cucumber

Change a models coordinate system origin

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

Since my last thread didn''t get much response I thought I might specify my question better. What I need to know is how to change the coordinate system origin in model space for a model. Right now all rotation are made around the models space origin and that origin is not where I like it to be. So how do I change it?

Share this post


Link to post
Share on other sites
Advertisement
To change the models origin you can do one of two things:

1) Build a transformation matrix that describes your new origin.
A.) Transform and overwrite all the models vertices by this
matrix. or,
B.) Save this matrix as a ''model origin'' matrix and have a
seperate ''transform matrix'' to move and rotate the
model. If you go with this option you have to combine
the two matrices by multiplying them together before
you render the object.

Share this post


Link to post
Share on other sites
Thanks for your reply.

Sorry I''m not all that good at matrix math so if you could just clearify this a bit.

Your first solution I think I undertand. Do you mean that I should multiply very vector in the model by the wanted matrix?
If that is correct then that solution isn''t very good since I use Vertex buffers and that solution would mean that I had to lock it to change it.

But I don''t undertsand what you mean in your secod solution.
If you could show me some pseudo code or something then that might help me.

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!