请找到管几何的网址:3d tube with 200 points of data passed in JSON format.
由于管的长度因点的数量而异,如何动态地围绕管几何创建透明立方体以覆盖立方体内的整个管结构,整个场景看起来像表面内的管道?
答案 0 :(得分:1)
geometry.computeboundingbox(),用于调整框的比例和框应放置的位置
scaleX = (max.x -min.x);
scaleY = (max.y -min.y);
scaleZ = (max.z -min.z);
positionX = min.x + scaleX/2;
positionY = min.y + scaleY/2;
positionZ = min.z + scaleZ/2;