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 / Need help with vertex manipulator

Author
Message
Mugen Wizardry
User Banned
Posted: 3rd Jan 2011 18:10
Hi all. I've decided to create a vertex manipulator, and need some help with it.

What I want to do, is have it so you can create ANY amount of vertices (spheres connected by lines) as you want, and still have it connect a line to each other vertex.

Here's the code:



CHECK OUT SOME MUSIC FROM MY NEW TECHNO CD! TECHNOKINESIS
http://www.youtube.com/watch?v=4a8KedfgVv0
ALSO, CHECK OUT MY NEW TECHNO CD AT Amazon.com!
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Jan 2011 22:45 Edited at: 3rd Jan 2011 22:46
If you're talking about adding vertices to the array, then what you want to use is array insert at bottom or array insert at top (use the help files for the details). Those commands allow you to add elements to an array, like your vertex list. I think it'd also be best to look at the commands array count(), array delete element, or pretty much any array command that looks useful.

Let's say you have an array Vertices() as tVertex, then you can add one vertex using
array insert at bottom Vertices()

then you can fill the new vertex by using
newItem = array count(Vertices())
Vertices(newItem).*** = ...
Vertices(newItem).ObjectID = blabla
make object sphere blabla, size# etc.

and then you have all the information you want. If you would need to connect 2 vertices with ID = a and ID = b
obj1 = Vertices(a).ObjectID
obj2 = Vertices(b).ObjectID
Draw3DLine(object position x(obj1), object position y(obj1), object position z(obj1), object position x(obj2), object position y(obj2), object position z(obj2))

Cheers!
Sven B

Login to post a reply

Server time is: 2026-07-18 03:15:11
Your offset time is: 2026-07-18 03:15:11