How do you implement this?
Hi,
well I''m writting a game engine (surprise!) and I have a question that don''t let me sleep. I have a class that encapsulates a Mesh. So, now I have to choose: how I store the orientation of my mesh?
I see two ways:
- Keeping the euler angles: rotation around the 3 local axises. So I could rotate the object unsing something like:
rotateX(rotx);
rotateY(roty);
rotateZ(rotz);
The problem is that the order of rotation is significant another problem: I have to rotate the mesh around its local axises, and I don''t know why (any ideas?).
- The other way could be keeping the object''s transform matrix, annd instead of having three angles I''d have 3 vectors determining the orientation of the local axises.
The question is: What is the best way to do that? How do you implement that? Any idea to rotate my object locally??
Thanx.
Storing a matrix would work, but you would slowly accumulate errors due to rounding. You can fix that by occasionally recalibrating them. I recommend you research quaternions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement