开发者

Derive euler rotation from model view matrix

I'm implementing a widget tool kit wich requires some symbols to be aligned with the Y axis.

These symbols are drawn using the model view matrix of the parent objects, causing them to be rotated as well.

The solution would be to apply a counter-rotation before rendering those symbol开发者_如何转开发s, but I have to keep track of every rotation (in my case only on Z axis), in order to apply the correct counter-rotation. Sadly, every rotation "out of control" will cause a misalignment between the real model view matrix rotation and the "global" rotation kept.

How would it possible to derive eurler rotation angles directly from the model view matrix?


Just clear the rotational part (the upper left 3x3) of the modelview matrix to identity. This removes any rotation, yet retains the translation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜