我通过创建具有顶点的几何体,然后构建面来构建自定义网格(八角形棱镜).我现在正在尝试添加鼠标悬停交互,但是Raycaster不返回此网格的交叉点.
我认为这是网格的一个问题,因为其他几何在场景中的交叉点上正确返回.
这里可以看到一个完整的例子:http://jsfiddle.net/mattheath/3qxzS/
var x, y, z, width, height, opacity;
// Container object
var octagon = new THREE.Object3D();
// Adjust registration point to bottom of object
y = y + height / 2;
// Default opacity to non-transparent
opacity = opacity || 1;
// Calculate distance from edge of a cube the octagonal side starts
var cornerRadius = ((width - (width / (1 + Math.sqrt(2)))) / 2) * 0.85;
// Boundaries
var xMin = x - width …Run Code Online (Sandbox Code Playgroud) three.js ×1