Hi, I’m working on a new problem and wanted to start a thread to help guide me in the proper direction. The community here has always been helpful and I will follow up with a PG for documentation and support.
I intend on orienting a mesh to a plane by 3 points. The user picks 3 points and the mesh moves such that those 3 points are on a plane (pre-defined ground plane). The points will also describe the orientation / alignment with global axes (pt 1 at origin and pt 2 along x axis and pt 3 as positive y). It could be interactive in that after each pick the point moves to the plane and keeps the previous point on the plane, or move all at once after the points are defined.
What’s a good strategy here? Below is what I’m going to work on:
- move point 1 on mesh to origin
- set mesh pivot as origin
- get point 2 location
- get difference of plane and point2
- move (with origin as pivot) the difference
- create new pivot based halfway between origin and pt2 (maybe make a line and use midpoint)
- get point 3 and move difference to plane from the new pivot.
Not 100% sure my process will get me there but I’m going to start on it later this week. I’m also interested in some of the built in matrix translation tools that may make the math easier. I always appreciate the communities feedback!
Thanks!