开发者

How to implement translation & rotation widgets for game level editor

I am developing 开发者_运维问答game editor.To detect mouse hit on 3D model I am using mouse picking concept. But I want to implement translation & rotation widgets like other game editor with actual arrows at the center of model in three direction. How to achieve this..? Can anyone suggest sample code for the same?


Any given object you select will have a local-to-world transform matrix.

Using DirectX its pretty easy to get the 3 Axes.
The first row of the matrix if the side (x) vector.
The second row is the up (y) vector.
The thidd row is the forward (z) vector.

Knowing the position (the 4th row) makes the trigonometry pretty easy to work out. Thus its pretty simple to do rotations and translations based on this info.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜