In theory, I should be able to skip steps 1, 3 and 5 as long as I apply the world rotation matrix and the existing one in reverse order (world * existing). I've already tried it that way (it didn't work) so I'll need to try the axis-angle matrix. I'll do it tonight and give you an answer one way or the other.
Paulcoz.
Edited by - paulcoz on June 25, 2001 11:47:35 PM
Rotation about world, instead of object axes?
O.k, the five step idea I mentioned didn't work (that was my invention so was understandable!), and neither did the axis-angle one.
If you recall I want to rotate around the world axes, not the object's axes so I plug in the unit vectors 0,0,1 ,0,1,0 and 0,0,1 without an angle to see what the axis-angle matrices look like compared to my existing rotation matrices (seen in first post of this thread). It's exactly the same thing for these particular unit vectors so I guess I've got the matrix right - I'm doing something else wrong.
Perhaps it's something to do with the matrix multiplication order, or maybe I need to transpose or inverse one or more of the matrices first, or after multiplication. I'm all out of ideas, so if anyone else has any, I'm all ears!
Paulcoz.
Edited by - paulcoz on June 28, 2001 8:08:51 PM
If you recall I want to rotate around the world axes, not the object's axes so I plug in the unit vectors 0,0,1 ,0,1,0 and 0,0,1 without an angle to see what the axis-angle matrices look like compared to my existing rotation matrices (seen in first post of this thread). It's exactly the same thing for these particular unit vectors so I guess I've got the matrix right - I'm doing something else wrong.
Perhaps it's something to do with the matrix multiplication order, or maybe I need to transpose or inverse one or more of the matrices first, or after multiplication. I'm all out of ideas, so if anyone else has any, I'm all ears!
Paulcoz.
Edited by - paulcoz on June 28, 2001 8:08:51 PM
Paulcoz -
Here''s what you need to do. You need to find transform the world axis into your local frame, then rotate around that axis. In general this requires an inverse of the current matrix. Show me the code of my three step process and I''ll tell you what you are doing wrong.
Mike
Here''s what you need to do. You need to find transform the world axis into your local frame, then rotate around that axis. In general this requires an inverse of the current matrix. Show me the code of my three step process and I''ll tell you what you are doing wrong.
Mike
Sorry Mike, I think I see what you mean now - you have to transform the world axis you want to rotate around into the coordinate system of the existing 3x3 matrix before you rotate around it.
Paulcoz.
Edited by - paulcoz on June 28, 2001 11:55:28 PM
Paulcoz.
Edited by - paulcoz on June 28, 2001 11:55:28 PM
Hi Mike, it''s working now thanks.
Do you have any screenshots or demos of your own project I can have a look at? It seems I''ve been making some progress on my own project (a level editor), but there''s always someone out there who''s already been through all the stuff I have whenever I have a question - I''m surprised there aren''t more people eager to show off their work!
Paulcoz.
Do you have any screenshots or demos of your own project I can have a look at? It seems I''ve been making some progress on my own project (a level editor), but there''s always someone out there who''s already been through all the stuff I have whenever I have a question - I''m surprised there aren''t more people eager to show off their work!
Paulcoz.
quote:Original post by paulcoz
Do you have any screenshots or demos of your own project I can have a look at?
My last project was a Q3A level loader; I don''t have any screenshots readily available mainly because I don''t have the inclination to make a website. If you can imagine, it looked similar to quake 3
Mike
two quite easy ways: if you do matrix multiplication, then having the matrix one side will result in a local transformation and having it on the other side will result in a global transformation. so all you have to do is let the two matrices switch places.
reason. left or right side decides if your transformation is applied before or after. obviously doing it before means doing it when local and global is still the same.
the other option is to use the transposed of the axis you want to rotate around, as an orthonormal matrix can be inversed by simply transposing it.
if you have this:
x0 y0 z0
x1 y1 z1
x2 y2 z2
you rotate around x1 y1 z1 instead of y0 y1 y2 etc.
in my camera im using the first version for directx and the second for opengl and they both work fine.
[edited by - Trienco on August 23, 2003 3:30:16 AM]
reason. left or right side decides if your transformation is applied before or after. obviously doing it before means doing it when local and global is still the same.
the other option is to use the transposed of the axis you want to rotate around, as an orthonormal matrix can be inversed by simply transposing it.
if you have this:
x0 y0 z0
x1 y1 z1
x2 y2 z2
you rotate around x1 y1 z1 instead of y0 y1 y2 etc.
in my camera im using the first version for directx and the second for opengl and they both work fine.
[edited by - Trienco on August 23, 2003 3:30:16 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement