Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Creating curved roads

Author
Message
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 26th Mar 2007 10:28 Edited at: 2nd Apr 2007 18:17
Edited: This code is broken. Get a better version in following posts.

I've been thinking about making a motorcycle simulation, but I don't know a whole lot about meshes and matrixs and limbs and such, so I wanted to see if I could make roads just by creating triangle objects, and the answer turned out to be yes. I wrote a function that will create road sections where you can set the radius of the inside and outside of the turn, the degrees of the turn, and the number of triangles per section. I still have some more work to do, but the nuts and bolts of it are working. I'd like some folks to look at this and see if this is even practical for a simulation. Thanks all.
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 26th Mar 2007 10:32
Good work.



Cheers,

-db

Enter my forums here.
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 26th Mar 2007 11:38
Most roads / raceway tracks are created in outside modeling applications and the curvature of the texture is achieved through UVW mapping. I think it would be a good idea to just include a zip file with all the media so it would be easier for people to try it out.

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 26th Mar 2007 17:28
I know I could have modeled the road, but I eventually want to be able to use this function to draw a road using GPS track data. If anything, this was a good excercise in learning to plot points on a circle!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Mar 2007 04:55
Hmmm, dynamic race tracks anyone?

Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 2nd Apr 2007 11:10
ok, still been working on this, and I think I've made some improvements. Frame rate greatly improved by making each turn its own object. To use the function, you just declare the globals at the top of the code, initialize them, then call the drawroad function. You must alternate between left and right turns for now, still haven't fixed two turns in the same direction back t back yet. Any comments greatly appreciated.
Oh, if you want, you can adjust the z values inside the function to create hilly roads. Have fun.

Attachments

Login to view attachments
Visigoth
19
Years of Service
User Offline
Joined: 8th Jan 2005
Location: Bakersfield, California
Posted: 2nd Apr 2007 11:12
here is an exe

Attachments

Login to view attachments
Chris Franklin_
17
Years of Service
User Offline
Joined: 21st Dec 2006
Location: Home
Posted: 2nd Apr 2007 11:13
Neat Nice work.

Login to post a reply

Server time is: 2024-04-19 08:09:12
Your offset time is: 2024-04-19 08:09:12