THREE.js:计算对象上某个点的世界空间位置 [英] THREE.js: Calculate world space position of a point on an object

查看:32
本文介绍了THREE.js:计算对象上某个点的世界空间位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 3D 对象.附加"是一个点.当物体移动或旋转时,点也随之移动和旋转.

I have a 3D object. "Attached" to it is a point. When the object is moved or rotated, the point moves and rotates with it.

给定对象的位置和旋转,如何计算该点在世界空间中的位置?(如果可能,使用 THREE.js 的 API)

Given the object's position and rotation, how can the position of the point in world space be calculated? (Using THREE.js's API if possible)

谢谢

推荐答案

对于对象局部坐标系中的点,

For a point in an object's local coordinate system,

object.localToWorld( point );

将返回点的世界坐标,假设对点应用与对对象应用相同的变换.

will return the world coordinates of the point, assuming the same transform is applied to the point as is applied to the object.

three.js r.55

three.js r.55

这篇关于THREE.js:计算对象上某个点的世界空间位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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