How to rotate a model on a plane?

半腔热情 提交于 2019-12-12 01:25:37

问题


I am using a plane geometry to represent a terrain model with different "y" values(altitude). Also using the raycaster function I am able to move the model on the plane.

  1. I need a way to rotate the model a be parallel with the current face its on without changing its path orientation.
  2. Is there a way to define rotation by a face of a geometry?

回答1:


theCorrect me if I'm wrong here, it sounds like you want to have both local (on the face) and global (in the direction of your "path orientation") rotations integrated here. This is, in general, one of those tricky and somewhat context-specific problems that will require you to mix two different sources of rotation. In a typical Euler-style rotation, it sounds like you want to rotate around Y according to the path (I'm assuming the path is in top-down 2D here -- it's these assumptions tat make the problem impossible to definitively answer!), while rotating around X and Z according to the normal of the surface. Try taking assembling a THREE.Euler that way -- does it get you in the neighborhood?



来源:https://stackoverflow.com/questions/31626899/how-to-rotate-a-model-on-a-plane

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!