Advertisement

terrain

Started by December 02, 2003 11:50 AM
2 comments, last by evanmars 21 years, 3 months ago
Could somebody give me a hint on the best (easiest) way to make something like an oval race track with banked corners? I keep thinking of a mesh or something, but I''m not sure how to go about it. I''m sure it''s something simple and all I need is a boot to the head.
You mean procedurally?

Just run your vertex coordinates through an ellipse function (stretched out circle will do) - this''ll give you vertex coordinates on the xy plane. If you need to add corners to your track, just rotate the coordinates around they y axis where you want the origin of the curve to be.

However, I''m pretty certain I misunderstood your question, so perhaps you could be a little more specific as to what you''re after - that would make it easier to help.





"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Advertisement
Store points of data to make up a connected line to form the track.

At each point store information such as
x
y
z
bank
pitch
width

as well as track type information.

Chose a subdivision resolution (fixed # of segments between each set of points, or fixed step size in distance between point a and b)
and do some sort of cubic interpolation of the positions and values. For track type, just have it switch at the vertex (blend between types or whatever is necessary.)

This way your track is layed out in a way that it''s easy to generate a map image. It''s easy to figure out what percentage of the course the player has done. And you can make sure he''s hit all the check points along the way (so he can''t just back up and roll over the finish line.)

As for the math for the quadstrip generated by this method, well, it''s not too hard, I''m sure you can figure it out.

-Michael

ps. For the stuff around the track, you''ll either want to do something similar, maybe built into another ''track type'' sort of variable. Or you could use the fixed mesh approach. The advantage of this linear approach is its ease of making a decent LOD method for it.
Crispy:
Thanks. Sorry I didn''t have a more specific question. I wasn''t sure exactly what it was that I wanted. I didn''t mean procedurally, but now that you mention it...............

Thr33d:
Thanks. That is what I was thinking of. Thanks for spelling it out for me.

This topic is closed to new replies.

Advertisement