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 grid, block creation

Author
Message
T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 23rd Jan 2010 23:05
hi iam working with dbpro,
i want to make a grid in 3d and if you click somewhere on that grid, a block is created. if i click on that block (on the left side or right side, or top) a second block will be created next to it.


what is the best way to achieve this?
FireIndy
17
Years of Service
User Offline
Joined: 17th Jan 2007
Location: US of A
Posted: 24th Jan 2010 03:30 Edited at: 24th Jan 2010 03:31
Look at making matrices. Then for creating objects and somewhere in 3d with the mouse, youll want to use pick screen() and pick object(). Both of those, using the 2d mouse coords, can return 3d-world positions. Pick Object() returns an object number though from those 3d coord.

Programming is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning.
T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 25th Jan 2010 11:13
ok i have the things you said implemented in my program (and a few more things to control).

i can now instance a object on the X,Y,Z position of my (3D) mouse. iam very happy about that!

i created a matrix, but how can i interact with the matrix?
and how can i obtain the X and Z value of a tile of the matrix?
and how can i snap my block to a matrix tile?

thanks for helping me out!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Jan 2010 15:49
This will tell you pretty much all you need to know about matrices:

http://forum.thegamecreators.com/?m=forum_view&t=96038&b=7

TDK

T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 25th Jan 2010 17:05 Edited at: 26th Jan 2010 12:53
TDK, i readed your information but thats only to give a matrix a texture and how to do that. and to edit the height of a tile in the matrix.

i search the forums for obtaining the X and Z value of a matrix, but i cant find that.

but is it really possible what i try to do?
can i set collision on a matrix and then obtain a X and Z value? or am i thinking to complicated?

edit: does some have a code example for the function: get matrix height?

Login to post a reply

Server time is: 2024-11-23 19:26:26
Your offset time is: 2024-11-23 19:26:26