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 / Newb 3D world importing question

Author
Message
Veeds
16
Years of Service
User Offline
Joined: 1st Nov 2008
Location:
Posted: 1st Nov 2008 16:59
Okay, I just started to program, and I've tested simple, basic worlds, and got them to work. Although now I want to get more creative and expand on ideas, etc, etc..

How do I import a 3D World Studio file into the DarkBasic Pro program?

I know there is a code, but I am unsure how to set it up so that it works when I F5 it.

Thanks for the help ill be checking regularly!

Thanks
Veeds
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 2nd Nov 2008 01:10 Edited at: 2nd Nov 2008 01:16
Export the 3D World Studio level as a ".x" or ".dbo" and use the LOAD OBJECT command.

Veeds
16
Years of Service
User Offline
Joined: 1st Nov 2008
Location:
Posted: 2nd Nov 2008 03:15 Edited at: 3rd Nov 2008 13:44
Okay so I figured all that out, but when I try to load stuff it doesn't work, here is my code...


Sync On
Sync Rate 60
Hide Mouse
autocam Off

Backdrop On
Set Camera range 1,5000
Color Backdrop RGB(255,238,128)

Rem texture matrix
Load image "Cocuments and SettingsCompaq_OwnerDesktoptesttestbmp.bmp",1

rem Load object
Load object "Cocuments and SettingsCompaq_OwnerDesktoptesttestmap.x",2
Loop object 2

Rem Main loop
Do
set cursor 0,0
print X#
print Y#
print Z#

Rem Store Object angle
CameraAngleY# = Camera angle Y()

Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,20)
ZTest# = Newzvalue(Z#,CameraAngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
Move camera 10
Endif
Endif

If Leftkey()=1 then Yrotate Camera Wrapvalue(CameraAngleY#-5)
If Rightkey()=1 then Yrotate Camera Wrapvalue(CameraAngleY#+5)

X# = Camera position X()
Z# = Camera position Z()
Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+35,Z#

Rem Refresh Screen
Sync
Loop
Veeds
16
Years of Service
User Offline
Joined: 1st Nov 2008
Location:
Posted: 2nd Nov 2008 16:56 Edited at: 3rd Nov 2008 03:06
actually I got the world to go in testing phase, but for some reason all the terrain I created in 3d World Studio, I go RIGHT through it when I walk.. Any idea?

I am assuming I need a heightmap or something like that, but how do I code that exactly? Sorry for being a newb, just trying to get things situtated

HERE IS THE NEW CODE
Blobby 101
18
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 5th Nov 2008 08:48
hmm... do you have any collision code in place?
Veeds
16
Years of Service
User Offline
Joined: 1st Nov 2008
Location:
Posted: 6th Nov 2008 04:28
Im assuming no since from what ive been reading the terrain collision would make me walk on top of everything, and not through it, so im going to say no on that one, and if you could help me get one together that would be superb, since I will be using it for a 3rd person + 1st person test game.
Tom0001
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location:
Posted: 17th Nov 2008 13:07
There's a command for setting collision automatically for stuff like this...

Something like 'Set Object Collision to Spheres' or map, or whatever, I don't know. Just type 'Set Object' then press Ctrl+space to get up the list of commands starting with 'Set Object'.

Login to post a reply

Server time is: 2024-11-24 16:25:11
Your offset time is: 2024-11-24 16:25:11