THREE.js:计算物体上一个点的世界空间位置 [英] THREE.js: Calculate world space position of a point on an object
本文介绍了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屋!
查看全文