I have a mesh object on a floor and based on a click I want to rotate that mesh so it is on the floor. I'm able to get the click and select the mesh but how can I get the face to figure out how to rotate it.
Asked
Active
Viewed 40 times
1 Answers
0
It's hard to say without code example, but probably you're looking for:
Use Raycaster intersectObject for determining both mesh and face you're clicking at;
Determine face rotation by looking into face normal vector . Note that you must call
Geometry.computeFaceNormals()
before using it if you build your mesh manuallyRotate mesh around face center to the angle, which can be calculated from face normal vector. The simplest approach to rotate around Vector3 here
Hope it will help

Andrew Gura
- 382
- 2
- 11