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 Discussion / how to randomize objects on matrix

Author
Message
gamer3999
17
Years of Service
User Offline
Joined: 28th Oct 2007
Location:
Posted: 29th Oct 2007 04:41
I have a bunch of random object and I have a random matrix. How do I place those random objects so that they are on top of the matrix instead of being all over the place.
Robert The Robot
18
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 29th Oct 2007 13:21
Quote: "a bunch of random object "


If you mean loads of objects placed at random locations(random x, y, and z numbers), then you need to use the Get Ground Height Command. For each object, you set it's Y-Position to be the height of the matrix at the objects X and Z Position:

objy# = get ground height(1, objx#, objz#)

In the code above, 1 is the Matrix number, and if you need to move the objects higher up off the ground, you can always increase the Y# afterwards.

Hope this helps!

On our way 'ome, on our way 'ome...
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Oct 2007 16:46
Also, most of DB's objects are centred at 0,0,0 so to have them sitting on top of the matrix, instead of the matrix bisecting them, you'll have to move them up by half their height again


"You must be someone's friend to make comments about them." - MySpace lied.

Login to post a reply

Server time is: 2025-05-31 20:47:34
Your offset time is: 2025-05-31 20:47:34