PDA

View Full Version : CO-ORD detection



-=dabomb=-
12-08-2000, 01:38 PM
how do i figure out the y value of a point under an object.
lets say i have a box moving along some random terrain. when it encounters a hill i want its Y co-ord to be whatever the Y value of the terrain exactly under it is. Is there a way to do this?
Cheers

12-08-2000, 01:52 PM
That depends entirely on how you store your
terrain. If it's a height field, you can
linearly interpolate between the four corner
samples for the "quad" the vehicle is over.
If you have a "driveable mesh" you have to
find the triangle which contains the vehicle
and calculate the Y of the vehicle's position
from the three corners.