admin管理员组文章数量:1426950
I am trying to configure the position of a THREE.plane for localClipping, and Im finding it a little unintuitive. I had a thought, is it possible to create some planeGeometry, manipulate it, and convert its position and orientation to the create a THREE.plane in its place?
This would be useful for configuring the position of a clipping planes.
I am trying to configure the position of a THREE.plane for localClipping, and Im finding it a little unintuitive. I had a thought, is it possible to create some planeGeometry, manipulate it, and convert its position and orientation to the create a THREE.plane in its place?
This would be useful for configuring the position of a clipping planes.
Share Improve this question asked Sep 1, 2018 at 1:06 8195mike8195mike 901 silver badge8 bronze badges1 Answer
Reset to default 8You want to set a THREE.Plane
from a Mesh
having a PlaneGeometry
, and you want to take into consideration the mesh's position
and quaternion
(or rotation
). In other words, you want the THREE.Plane
to align with the planar Mesh
.
The easiest way to do that is to use plane.setFromNormalAndCoplanarPoint()
.
The normal is the normal to the plane mesh after rotation. The coplanar point is any point in the plane mesh; the position
will do.
var plane = new THREE.Plane();
var normal = new THREE.Vector3();
var point = new THREE.Vector3();
normal.set( 0, 0, 1 ).applyQuaternion( planeMesh.quaternion );
point.copy( planeMesh.position );
plane.setFromNormalAndCoplanarPoint( normal, point );
three.js r.96
本文标签: javascriptTHREEjs Turn THREEplaneGeometry to THREEplaneStack Overflow
版权声明:本文标题:javascript - THREE.js Turn THREE.planeGeometry to THREE.plane - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745409551a2657402.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论