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.

Newcomers DBPro Corner / 3d roads and other link-type models?

Author
Message
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 6th Oct 2008 04:21
So I've looked around and searched for a way to link and place objects like you would a road in SC4 or any other city builder game. THe only thing I came across was tiling with a texture or with multiple textures for various types of transits. But no where have I found ways to create 3d roads and such. Has any one had any luck in this area or is there a tutorial I can look over that I don't know about. What ever I come up with from any one or any tutorial I'll share in return... I just need a little direction

-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 6th Oct 2008 10:40
This may help a little. It's a grid-based track game + source code. I had a whole routine dedicated to comparing each track cell and working out which directions I needed to the track to travel based on it's neighbours.

http://forum.thegamecreators.com/?m=forum_view&t=90292&b=5



Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 6th Oct 2008 20:56
Thats close to what I mean. The path following will be custom however as I havent invested in DarkAI on this computer. If there's any one else who can provide examples it would be greatly appreciated.

-Daryn

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 6th Oct 2008 23:33
Wee! okay, so I've gotten the object(S) to loop and place on a matrix (which in the simulation game I am designing) will be placed over the terrain ONLY when you select a tool unless otherwise an option for the user.

My trouble now is storing the X, or Y values for the mouse based on the position of the camera from the matrix... in other words:

1 2 3 4 5 6 7 8...
2 O
3 B
4 J
5 E
6 C
7 T
8

See how the object is placed on 2,2 and ends on 7,2... I need to store the 2 value based on the place you click on the matrix relative to the camera position and NOT STORE the 7 value (so you draw a straight line rather than some criss-cross mumbo-jumbo diagonal-hell ) You can then- based on the position of the mouse and matrix- rotate the object... this can be used to create |,/,-,\, angled objects or even more indepth object angles based on the mouses position. (My explanation is a little confusing so theres an image you can look at and understand better

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Attachments

Login to view attachments
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 8th Oct 2008 22:36
Simply program it so that on the first click it sets a flag:



To reset it, set the variable "flag" to 0.

When the flag is equal to 1, draw the line:



Presumably you'd want to use an object rather than a line:



You'd be using the grid coordinates rather than mousex() and mousey() if you're working in a 3D world. Just do a simple Search/Replace.

Good luck,
Calcyman

The optomist's right, The pessimist's right.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 10th Oct 2008 23:30
That was VERY helpful Calcyman!!! But what if I wanted to just repeat an object over and over... like segments and then when I click again, bind all of these objects into one object or turn it into one mesh and delete these objects? How would I repeat these objects in a line relative to the first click? (IE... like the 2d line's pixels... how do I do that in 3d w/ the same object repeating... the object number would have to be an iNC value... but beyond that my mind is lacking) I'll fool around with it and see what I come up with.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.
Daryn Alsup
16
Years of Service
User Offline
Joined: 5th Jul 2008
Location: In your head... dun dun DUN!!!!!!!!
Posted: 13th Jan 2009 09:11
Okay so I can use all of the above (sorry for 2X post) but what I really need now is an understanding of vertex commands. This will help when a piece of road or what ever needs to make a <90 turn. Not completely right angled intersections, transitions from a ground freeway to an elevated highway and so on. It would be awesome if some one who has done or knows how to draw objects like a line(s) without the rough edges. ANY help is welcomed and encouraged as is any help understanding the vertex commands.

Jack and Jill went up a hill to fetch a pale of water... but Jill got tired of his s#%& so she shot him.

Login to post a reply

Server time is: 2024-11-24 14:28:16
Your offset time is: 2024-11-24 14:28:16