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 / Adding a plain building

Author
Message
ORLY
18
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 28th Aug 2006 08:21
Hi, im using darkbasic pro, how would i add a building/cube/rectangle sitting ontop of the created matrix? im confused with it.

here's my code:


attached is ground.jph(from the tutorials)

Attachments

Login to view attachments
ORLY
18
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 28th Aug 2006 15:33
ok so i guess adding a 'cube' was easy.

here's my code now


My second question is, How do u check collision against the cube and the box(arrow keys to move the tiny block, also, when u start it up, drag your mouse bottom-left a little to see the matrix).
demons breath
20
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 28th Aug 2006 16:36
i'd do it something like this:





by the way you do know that your mouse movement only works right and down at the moment don't you?

the cube isn't in the place where you see it when you start off it's just at a random point on the matrix but you'll see it if you move the mouse down...

and it's at height 25 because DB registers the height from the center of the object and the cube i drew is 50 units tall and half of 50 is 25 so the center is in the right place so it appears to be sitting on the ground

to load an object in you would have to use



don't forget the extension and make sure if it is in a different folder you include the complete path to it

you may also have to scale the object if you load it


thats about all i can think of to write so i hope that's helped...

RIP Dimebag
http://db1games.topcities.com
(used to be demonsbreath)
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 28th Aug 2006 17:55
Have a look at GET GROUND HEIGHT. Here's your code with this put in. Like demon said, DB draws cubes with the center point or origin of the cube being in the middle. So, here is your changed code with the cube thing added.


ORLY
18
Years of Service
User Offline
Joined: 28th Aug 2006
Location:
Posted: 29th Aug 2006 08:37
demons breath wrote: "
by the way you do know that your mouse movement only works right and down at the moment don't you?
"


yeh, i fixed it awhile ago, just accidently wrote "scrollspeed" instead of "speed".

ok so a third question, how to detect collision between a .x obj with the camera?

You can find the .x object from 3D world studio folder(examples)

My fourth question is, how do you texture the .x object?

Login to post a reply

Server time is: 2024-09-25 07:33:47
Your offset time is: 2024-09-25 07:33:47