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 / Basic 3d world

Author
Message
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 17th Nov 2011 00:08
Whats the easiest way to create a basic 3d world? i just need a playing field that i can make a cube/model run around in. i can retexture everything later.


please and thank you

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 17th Nov 2011 03:24
Play around with this:



It means:



And use

make object box ObjectNumber,10,10,20:color object ObjectNumber,rgb(0,0,255)

Pretty much this:



-------------------------------------------------------------
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 17th Nov 2011 03:34
I'll try this out. Thanks a lot darkzombies

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 17th Nov 2011 07:10
No problem

-------------------------------------------------------------
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 17th Nov 2011 16:26
i just tried it out.....it force closes. if i put a wait key in there it shows the matrix and everything, but as soon as i try and move my object, it closes. is there something wrong with my coding?



http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 17th Nov 2011 17:07
after you move it, it goes past the code and ends, you need to have it loop. Here's an example.



Of course you would also want a way to store the values of how much it is rotated and where it is in 3D space, but for now that should work.

-------------------------------------------------------------
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Nov 2011 19:10
I took Darkzombies' code and added some things to it. This code will create a speckled texture and will put this texture on all of the tiles in the matrix. Also, the camera follows the cube around. I commented it to try and help you understand what it is doing. Hope this is helpful.




scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 17th Nov 2011 19:34 Edited at: 17th Nov 2011 23:43
i will try this out later LBFN, thanks for the code and i'll tell you how it works out for me.


edit: i just tried out the new code, thanks LBFN, it works great. i'll have alot of fun tinkering with it. the program will be ok if i try to add collision objects, and retexture the floor correct? and thanks for the REM statements explaining everything, really helped me understand what you were doing and why

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 18th Nov 2011 02:12
Thats nice, I would recomend next looking into types and functions and while loops and repeat untils and a bunch of stuff like that. And I would direct you to TDK's tutorials, but that's kinda overused. Its probably better to look at the command list and experiment, I might direct you to it later but you know, practice makes perfect.

-------------------------------------------------------------
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 18th Nov 2011 02:40
k, i'll look into that stuff, thanks again darkzombies and LBFN!

quick question though, can somebody run this code? and tell me if they are getting the same problem i am? or if its just something messed up with my computer?(warning, alot of freakin' code!)

my problem tends to be the fact that i have objects positioned, but when i run the executable, all of the cubes are clustered up into 1 corner, not dispersed around the map as i had placed them. (also please ignore that 90% of the coding is rem'd out right now, i am turning it into an educational game for pre k-k to learn counting so i took out everything related to the monster.) and i do know there is no object collision boxes attached to the numbered cubes yet, i will fix that later.....

p.s. how long does the new member thing last? im kinda tired of having to wait for my comments to be accepted before they are posted.

and again, thanks in advance, and thanks for all your help so far.

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 18th Nov 2011 04:35
Did you also set the variable that you use to keep track of them when you placed them?

-------------------------------------------------------------
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 18th Nov 2011 05:16
No, I just made them from make object cube (501-520) and positioned them. Would I need a variable? If so what, and why do I need it?

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 18th Nov 2011 05:44 Edited at: 18th Nov 2011 06:37
Just alot of time people use variables like playerX, playerY, and playerZ. So I assumed you did something like this:



and put that in a loop so instead of repositioning you can just change the variables, so I just assumed you did that and forgot to set them or something similar.

EDIT: Ok, I think the problem is they're way too big, plus 3D space is alot bigger than 2D space, try positioning them way further apart.

Also, it's horribly inefficient, this will work the exact same.



It goes through 501 to 520 (Its represented as b) and sets the ID to that number, and makes them all pretty fast.

Also this should work, though you may have to (You actually should) size the RND down a bit.



And one final lesson.

So you could do this.



For the texturing, but its not as efficient as it could be.
Now its time to get mathy. (Not too mathy, don't freak out)



It was easy since its only 100 higher, but still, pretty simple.

-------------------------------------------------------------
scythe_reaver
FPSC Reloaded TGC Backer
13
Years of Service
User Offline
Joined: 14th Nov 2011
Location:
Posted: 18th Nov 2011 06:16
If I remember correctly I used to have this code for a while
[Code] for p = 51 to 70
Make object cube p,100
Posistion object p, rnd(1500),80,rnd(1500)
Next p


But I wasn't sure how to texture them. So I tried this

[Code] if p = 51 then texture object 51,601
if p = 52 then texture object 52,602
[/Code]

Etc etc. It wasn't working so I just made em by hand.

Thanks for the new code, I'll try it out soon

http://www.shrinkpictures.com/processed/phprZ6E7O_c2AM.jpg
"I AM YOUR GOD OF DEATH"
Darkzombies
13
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 18th Nov 2011 07:47
[ code] YOU'RE CODE HERE [ /code] (no spaces, no caps)

And yeah, it's all good to learn. Just trying to help.

And in fact, you could probably combine the texturing and creating into one for loop.



-------------------------------------------------------------
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Nov 2011 15:26
Here is another way you can load some of the images and some of the objects:



By making the cubes 300 in size (which is way huge btw), they all run together because you have placed them too close. Try a size of 30 and they show up okay.


Login to post a reply

Server time is: 2024-11-22 11:49:29
Your offset time is: 2024-11-22 11:49:29