开发者

Rotating a model in 3D: Suggestions for center of rotation

I need to allow the user to pan, rotate, zoom in/out of my scene in 3D which uses a parallel projection. Panning and zooming in/out has been pretty straight forward. However, when using the mouse for rotation, I am not sure what to use as the center of rotation. In particular, I am not sure at what depth inside the screen the center of rotation should fall.

Here is what I am doing right now: Take the centroid of the model and use that as the center of rotation. However, the centroid can at times fall outside the visible area (as a result of panning and the zoom level) and the user (and I myself) find it counterintuitive to rotate the model around a point we cannot see.

What is considered the standard for user-interaction in suc开发者_高级运维h a case? What could be the most intuitive behaviour here?

PS: I have only one view port (unlike Blender and friends).

Edit: It would be great if experienced parties could evaluate current practices in packages such as Google SketchUp and Blender 3D and post their opinions.


You could try casting a ray from the camera towards the center of the screen, finding the nearest and furthest intersections, then set the point of rotation at the midpoint of the intersection points.


I've seen a few solutions here, my favourite being to allow the user to set (and drag with the mouse) the center of rotation. You then grab a point on the model and drag to rotate about this centre. Less good but workable is the center of the viewport back projected into model coordinates.


I'm not sure if they like this better... but try to make the rotation rotate the camera, make it like the ones in first person shooter games. This might not go well with the mouse rotation idea but it is one of the most used and should be intuitive within seconds of use for the user.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜