This topic is now archived and is closed to further replies.


Driving Game

Recommended Posts

brain21    128
I am trying to make a driving game. I made the track in 3dmax using the donut shape to make all the polygones for this round test track. I rendered it to the screen and it looks fine. I also have a camera in 3d space (which is the car). I want to make to car stick to the track. I need some way of finding the camera height at a givin point on the track. To do this I need to find what poly the camera is now on and extrapolate the y(y axe is up/down) value of the polygone knowing all 4 vertexes. Heres what I do: (assume y axe is up/down, x axe is left/right and z is in/out) 1) I use a bounding box approch to find what poly im in. but this isnt enough. I then use the line equations for the lines that make up the poly to fiqure out if the camera is actually inside the poly. This long algo gets me the poly in standing in. Is there an easier way of doing this? 2) I use a sort of bilinear interpolation to figure out the y(height) of the point in the poly that im in. This isn''t working right. I think bilinear interpolations can only be used for polys that are straigth rectangles, and not rotated ones. Again is there a better way of doing this? Thanks in advance Denis Lamarche

Share this post

Link to post
Share on other sites