如何在平面上旋转模型? [英] How to rotate a model on a plane?

查看:67
本文介绍了如何在平面上旋转模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用平面几何来表示具有不同y"值(高度)的地形模型.同样使用 raycaster 功能,我可以在飞机上移动模型.

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. 我需要一种方法来旋转模型使其与当前面平行而不改变其路径方向.
  2. 有没有办法通过几何体的面来定义旋转?

推荐答案

theCorrect me if I'm wrong here, 听起来你想要同时拥有本地(在脸上)和全局(在你的路径"方向)方向")旋转集成在这里.一般来说,这是需要您混合两种不同旋转源的棘手且有些特定于上下文的问题之一.在典型的欧拉式旋转中,听起来您想根据路径围绕 Y 旋转(我假设这里的路径是自上而下的 2D——正是这些假设使问题无法明确回答!),同时根据表面的法线围绕 X 和 Z 旋转.尝试以这种方式组装一个 THREE.Euler - 它会让你在附近吗?

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?

这篇关于如何在平面上旋转模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆