I have a terrain and an object which should moves over the terrain so I made a function that can detect which face is the origin of the object locate above so I should set the Y of the object with the accurate height of the intersection point between the vector from the object origin perpendicular with the face, I have the three vertices of the face so I can calculate its normal and its origin and maximum and minimum pointes (bounded box).
Aucun commentaire:
Enregistrer un commentaire