开发者

Remove Translation from Matrix

Is it 开发者_Go百科possible to remove just the translation element from a Matrix object so that only Scale and Rotation elements remain?

Thanks


Just zero out the appropriate matrix elements. In a 4x4 3D-transform matrix, these are stored as the three first elements in either in the rightmost column or bottom row, depending on whether you use pre- or post-multiplication.

If your Matrix class has a method to get the translation, it probably also has a method to add translations. In that case, just add the opposite translation of what you already have.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜