0

I have an application that displays a cube. When the user clicks on the cube, I must know which face was clicked.

Thank to this example, I managed to display a cube and to highlight it when the user hovers it :

http://threejs.org/examples/#webgl_octree_raycasting

But the only thing I know is that the user intersects the whole cube, I don't know which face.

I can solve it by creating 6 faces instead of 1 cube and check intersections on each face.

My question is : Is it possible to know which face has been clicked without creating 6 faces individually?

4

1 回答 1

1

每张脸都有不同的face.normal,所以在你链接到的演示中,看看:

intersections[ 0 ].face.normal

三.js r.62

于 2013-11-05T15:45:55.633 回答