Archived

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

Mr Cucumber

Change a models coordinate system origin

Recommended Posts

Mr Cucumber    122
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
emfb    122
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
Mr Cucumber    122
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