#[SOLVED] Checking for closest face of a part to the ground
14 messages · Page 1 of 1 (latest)
is the ground flat or does it have hills/other stuff that makes it not be a flat plain?
I've to do some googling to find the exact steps, but it comes down to looking at the baseplate's rotation, and running to formula
RB = slope co. baseplate, RL = slope co. Line
RB *RL = -1
just have look up how to do the math to find the shortest path again
give me a second
oh right, it comes down to just filling out y = Mx + B
Yet of course you will have to sadly translate this math to work in a 3d work space. Yet that shouldn't be a real issue. The main thing you can do afterwards is just dependent on how you manage the face logic. You can either base it off of the different between the slop co. and the forwards vector of the shape. Or just rotate the object so the rotations match (depending of if you just wish to identify the right face, or make sure it's the right face)
I actually went and found a tutorial actually explaining how to do it in 3d https://www.youtube.com/watch?v=5BDrdI3rdQY. Main limitation with this is of course that this mostly works for (almost) spherical objects. so if you start using some very odd shapes then it may select the wrong face
This geometry video tutorial explains how to calculate the distance between a point and a line in 2D and 3D using the point line distance formula. It contains plenty of example problems.
Circles - Area, Circumference, Radius: https://www.youtube.com/watch?v=D4nGkWOPb6M
Circles - Chords, Radius, & Diameter:
https://www.youtube.com/wa...
thank you
stuff like this will be it's main downfall
solved