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 / Previewing Created Terrain

Author
Message
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 22nd Jul 2007 06:36
Well, i've been making a few terrain objects in 3D World Studio, and exported them into .X files. What I want to be able to do is load up the terrain model in DBP (obviously possible using the LOAD OBJECT command), and then look down on the terrain, so I can see what it looks like in-game.

I tried using some simple things like the LOAD OBJECT command, and then positioning the camera, but it didn't work.

All help is appreciated, thanks.


[center]
Jane Doe
17
Years of Service
User Offline
Joined: 29th Jun 2007
Location:
Posted: 22nd Jul 2007 09:34
What exactly do you mean by "it didn't work"? Did the model not load? Was it somehow not displayed properly? Did you not see it at all? Did the program fail to run altogether? What were these "simple things" you tried? Did you have camera movement so that you could look around in case the terrain was there but wasn't where you thought it was going to be? Was your camera range set appropriately? What was the cull state of the model?

In short, we need more info.

- Jane
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 22nd Jul 2007 10:18 Edited at: 22nd Jul 2007 11:35
Good point, thanks. I'll post the exact code I used and screens in a second.

EDIT : Here's the code i'm using, here, what i'm trying to do is get the player to walk along the terrain.



Media download attached so you can compile the source, and a screenshot link of the problem below below:

http://img172.imageshack.us/img172/3599/screen1jg7.jpg


[center]

Attachments

Login to view attachments
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Jul 2007 12:56 Edited at: 22nd Jul 2007 13:13
you are to low on the terrain

add some value to the camera y# position like:

Position Camera cX#,cY#+200,cZ#

[edit]
also notice that you are not checking the terrain height at player position

this may do it:

Function _ChaseObject(ObjectNum,Dist,Hei,MatrixNum)
`Store Object angle Y in aY#
aY# = Object angle Y(10)
`get player object position and store in X# and Z#
X# = Object position x(ObjectNum)
Z# = Object position z(ObjectNum)
th#=intersect object(1,x#,10000,z#,x#,-10000,z#)
y#=10000-th#
position object 10,x#,y#,z#

`get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,DIST)
cX# = Newxvalue(X#,aY#-180,DIST)
cy#=y#+100
`position camera
Position Camera cX#,cY#,cZ#

`point the camera at the player object
Point camera X#,th#+5,Z#
EndFunction
Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 22nd Jul 2007 13:43
I'm still getting the exact same result as before with the code you suggested Scorpyo, but thanks anyway.

Current code :



[center]
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 22nd Jul 2007 18:58
I apologize, I realize now that i left many mistakes unchanged in your code
here's a working example

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-26 12:42:56
Your offset time is: 2024-11-26 12:42:56