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.

Author
Message
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2013 00:00 Edited at: 25th Sep 2013 00:38
I've been trying some track editors, and made my own one, playing with bezier curves and way points, and the most difficult, joining the two ends. I made proves letting the user to make a maximun of 20 way points and automatically closing the circle and the result was ok but too complicated code as I like small codes.

One of my old codes,it gave me an idea... I thought about making the road by hand like driving a car, instead of being automatically. The idea comes from this code:

http://forum.thegamecreators.com/?m=forum_view&t=163098&b=11

So here's a small 3D road editor.
Move camera free with arrowkey and mouse

- Space to move
- inkey$ a to go left
- inkey$ d to go right

we have three size off bend
inkey$ 1, 2 , 3

-Controlkey() to see result, fron time to time, but we can continue
-m to finish and save the road as .x






I'm not a grumpy grandpa
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2013 00:05 Edited at: 21st Sep 2013 00:47
Here's a small game made with this 3D Road Editor
In this game nobody wins or loses, just drive at full speed on a sliding track full of desert sand.we drive at night, where the lights of the cars can dazzle and make us lose control of the vehicle.

You can see here a video of the game

http://www.youtube.com/watch?v=QdqRcnKCC-8&feature=youtu.be

my best time 12:11 ...let see yours

Cheers.

I'm not a grumpy grandpa
mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 21st Sep 2013 01:09

doesn't compile

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2013 01:51 Edited at: 21st Sep 2013 01:52
I can't figure out why not...try this compiled attached.

I forget to say that we need MatrixUtil plugin.

I'm not a grumpy grandpa
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 21st Sep 2013 19:03
Quote: "doesn't compile"

because of this:
Quote: "we need MatrixUtil plugin."


mr Handy
18
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 21st Sep 2013 19:07
Quote: "I forget to say that we need MatrixUtil plugin"

Oh! And what do new plain command?

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2013 19:23
Quote: "Oh! And what do new plain command?"


The default command MAKE OBJECT PLAIN of Dbpro, makes a primitive of ...let say side by side with four vertex , and the new command off MatrixUtils makes the same object but we can define how many rows of vertex having more control on the object especially if we use Vertexdata commands . This plugin is free (I guess) and I suppose you can download it.

Cheers.

I'm not a grumpy grandpa
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 21st Sep 2013 19:35
Quote: "and the most difficult, joining the two ends"


The way I join the ends in my editor is to duplicate the first and last nodes, and share the same bezier control handles. I also start with an almost circular track, then let the user edit the pieces, nodes and handles. It works ok, and is not too difficult to code. Just remember to move first and last nodes at the same time!



chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2013 21:45
@BatVink
That is exactly as it must be, but we need to put some extra points near the end to avoid a hard bend. In my other system, I notice that close to bends we had more vertex than the rest of the road, so when we make triagles or whatever we use to buit up the road, we need more triangles in bends,and will make irregular texture...that's why I try this method of adding vertex with a counter, an we can even make the road in real time as we drive over our terrain.

Cheers.

I'm not a grumpy grandpa
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Dec 2013 19:52 Edited at: 6th Dec 2013 20:04
hi

I know this was started to make race tracks with

but what about a road system

even the basics would be nice

example

*****|***|*****
*****|***|*****
*****|***|*****
------|***|-----
***************
------|***|-----
*****|***|*****
*****|***|*****
*****|***|*****

going more into bridges and tunnels would be a lot more work ;oP
well the bridges would be a bit easier than the tunnels to implement

I think using the mouse to move around would make it easier to view thing

this one defiantly inspires me ;O)

Thanks "chafari"


ahh ok the Tank with no media ;o)

I've been playing with that trying to get the tank trail longer
but the system rile slows down so I was building in "Dark Occlusion"

now that I am thinking about that could also be used with this
the length of road could be huge with out any loss of speed to the system

1000's of km/miles could be covered ;o)

any chance of pointer about getting the road to stop being built at one point and started some ware else and not joining things up ?

to move side ways - is to move forward
Since a Strait line gets thin fast
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 6th Dec 2013 21:02
Quote: "Thanks "chafari" "

You are welcome !

Quote: "any chance of pointer about getting the road to stop being built at one point and started some ware else and not joining things up ?"


We decide where to star and where to finish the road if we dont close the ring. This was an example for may race game, and of course we can add tunels and caves and whatsoever we need, as we make the road flat and then there is a subrutine that place every vertex on top of the surface.

I'm glad you like it ...Cheers.

I'm not a grumpy grandpa
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 8th Dec 2013 21:56
@chafari

missing image file "carred.jpg"

too bad it's limited to 20 items

the video looks like the old atari

to move side ways - is to move forward
Since a Strait line gets thin fast
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 9th Dec 2013 01:02 Edited at: 9th Dec 2013 01:07
@Resourceful
The way it works, is while we press spacebar and then we have tu turn using "a" key to go left and "d" key to go right. We just use cursor keys to fly over our road and see better.

About the carred.jpg image...you could use any image for your road, but here it is attached.

You can put much more than 20 items.

about the video...yes, it was just a small example to show how the programs works.



Cheers.

I'm not a grumpy grandpa
gwheycs62egydws
16
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 9th Dec 2013 18:14
@chafari

thanks

I wish under stood all this as good as you
but it a bit past me at this point

i understand how I could do this
but it's getting the exact thought in place to see the full picture
so to speak ;oP

to move side ways - is to move forward
Since a Strait line gets thin fast

Login to post a reply

Server time is: 2026-07-07 01:54:21
Your offset time is: 2026-07-07 01:54:21