CodeBase - draw curved road function
Return to the CodeBase listing
Category: Basic 3D
Version: 1.0
Information
Uploaded: 26th Mar 2007 03:15
Modified: 1st Jan 1970 01:00
Author: Visigoth
Summary
simple function to create curved road segments by using triangle objects. You can set radius of turn, angle of turn, width of road, and segments per section (resolution)
Full Description
by just typing in this:<br /> drawroad(1,xcenter,ycenter,300,400,16,180,prevangle,trianglecount)<br /> would create a 180 degree curved section of road with a width of 10 units (the difference between the inside radius and the outside radius), using 16 segments, each segment is 2 triangles, so 32 triangles total. The more segments, the smoother the turn. 8 segments per 90 degrees seems to work good. You can play with the z values inside the function where the triangles are drawn. They are all set to zero, but it is totally possible to change them and make banked turns or dips and hills.
Comments
No comments yet.