Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have GameObject's transform component(position+rotation) and shape mesh(array of vertices).
On each game tick I update coordinates of vertices relatively to game object's rotation.
And my current algorithm for this is:

foreach vertice {
Mat4 m = createIdentityMatrix(); 
rotateMatrixByAngle(m, angle, axis);
(Vec3) vertice * m;
}

The problem is, that I always need to create new identity matrix and rotate it by current angle of rotation, even if it's not changed from previous tick. I think that measuring delta rotation from previous tick is not a solution. And I would like to know, if there is proper approach of rotation.

Maybe I should store transform rotation data in a matrix? But that sounds crazy and odd.

share|improve this question
2  
Why does it sound crazy and odd? It's a basic optimisation. Store your rotation matrix and only recalculate it if either the angle or axis changes. – Cong Xu Mar 6 at 0:01

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.