选择从特定位置可见的顶点

时间:2016-01-09 09:33:23

标签: three.js autodesk

如何确定缓冲几何体的哪些顶点从场景中的特定位置可见? 我正在使用Autodesk视图和数据api和光线跟踪似乎不起作用。 目的是仅将函数应用于沿线的视点/矢量可见的3D对象的部分。

感谢任何帮助

bellow是代码示例:

var origin = new THREE.Vector3(1, 2, 3);
            var direction = new THREE.Vector3(3, 4, 7);
            var sphereMaterial = new THREE.MeshPhongMaterial({ color: 0xff0000 });
            sphereMaterial.side = THREE.DoubleSide; 
            viewer.impl.matman().addMaterial('adn-material-vertex', sphereMaterial,true);
            var directionSphere = new THREE.Mesh(new THREE.SphereGeometry(2, 20), sphereMaterial);
            viewer.impl.scene.updateMatrixWorld();
            var raycaster = new THREE.Raycaster(origin, direction.normalize());
            var intersect = raycaster.intersectObject(directionSphere, true);
             console.log("Intersect is: " + intersect); // returned intersect is empty
             //I also tried: intersectObjects with ray of objects and the result is the same

0 个答案:

没有答案