|
|
> and interpolate the different rotations between them, which is very hard.....
Maybe you should try to find an easyer way !
I use a different method. I use a file with the following format (Example: file with a closed track)
# Track File
# Num_Parts start_X start_Y start_Z start_Direction start_Releve
019 0.0 0.0 0.0 0.0 0.0 Comments can be put in the reminder of the Lines
# Track Parts
# Angle Distance Heigth Width Releve SubDivision
0000 48 0 8 0 0
+090 32 0 8 0 0
0000 32 0 8 0 0
+180 32 0 8 0 0
-090 16 0 8 0 0
0000 32 0 8 0 0
+090 32 0 8 0 0
-090 32 0 8 0 0
+180 32 0 8 0 0
0000 64 0 8 0 0
-090 32 0 8 0 0
+180 48 0 8 0 0
0000 64 0 8 0 0
+180 24 0 8 0 0
-180 24 0 8 0 0
+090 16 0 8 0 0
0000 16 0 8 0 0
-180 16 0 8 0 0
0000 32 0 8 0 0
For a straight, "angle" is always (0), and the "distance" is the lenght of the straight.
For a curve, "angle" is the turning degrees of the curve (ex:+40), and the "distance" is the radius of the curve.
"Height" is an absolute height value, where the end of that track part must end. (its absolute and NOT relative, because this makes the building of the track easyer.
"Width", is the track width in meters.
"Releve" is the absolute "roll" efect you can give to the track in degrees. (again absolute, because it's easyer)
"Subdivision" is a quality setup to select how many sections (polys) a track part must be built upon.
Specifically:
0 - means automatic setup (varies according to the angle and radius of the curve.
+N - means the exactly N sections
-N - means quality control over automatic setup
ex:
-2 means double default automatic setup
-1 equals default automatic setup
-0.5 halfs default automatic setup
Each following track part is glued to the end (build from the end) of the last track part.
This implementation, at least as it is, does Not allow you to make bifurcations.
You can actually do that, but you have to setup N track files, one for each track section which derives from a bifurcation, and glue/place them together.
Also this can be improved by defining the track as big set of spline curves (eventually with straight sections/splines).
> (because my track generator works sectorbased now, i do other tracks than this,
> seen in rally-games and so on, becuase NASCAR tracks are boring:) )
Do you ment the looping kind o racing? A closed track ?
Is that what is boring ?
With my setup you can define open or closed type of track.
To be closed, you have to provide a setup which meets both ends.
But all of this is usually used only for the development cycle, because, in the end if you want to achieve some similarity with a real track, you will have to eventually design the track in a 3D-CAD program.
|