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 / walking across rough terrain help please?

Author
Message
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 29th Nov 2002 08:10
I created an awesome ground with some rolling hills ans stuff, but my character (a sphere for now) will not go up the hills, just through them. No up, no down, just a mono line of altitude.

can anyone help please?

cypher
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 29th Nov 2002 09:52
Is it a Matrix or an external object?

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 29th Nov 2002 17:38
If its a matrix, I have code to follow the hills (in my example, those groovy DBP example waves)..

http://www.darkbasicpro.com/apollo/view.php?t=2594&b=6

Hope it helps
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 29th Nov 2002 18:57
it is a .x file.

I created a land terrain in MAX, converted to x, and I really hope to use it. My camera woks great, my character (well, sphere) moves just the way it should, but my sphere just walks through the small bumps and hills.

thanx in advance for any help you can offer
cypher

jotomicron
21
Years of Service
User Offline
Joined: 17th Nov 2002
Location: Portugal
Posted: 29th Nov 2002 23:26
you could try to look for collision.
Imagine your object is number 1 and the character is number 2.
make the following:



I think it will be, somehow, a little slow. But I only see this way of doing it.

Try! Say somthing!
Bye

PS:Hope this work...
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 30th Nov 2002 03:45
i'll give it a shot, thank you much!!

cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 30th Nov 2002 04:54
Here is my code...I really need help, I am more of a newbie than I thought. My sphere (body.x) floats endlessly above most of the terrain, but when it does reach a hill top (room.x) it goes right through it.

code as follows

SET DISPLAY MODE 1024, 768, 16
sync rate 60 : hide mouse
load object "./objects/body.x",1
load object "./objects/room.x",2

rem body move
do
if upkey()=1 then move object 1,4
if downkey()=1 then move object 1,-4
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-4)
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+4)

rem follow body with camera
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
while object collision(2,1)=2
y#=y#+1:`use a higher number if you want it a little quicker. However,
`doing it will make this uglier! Your decision, here...
position object 1,x#,y#,z#
endwhile
a#=object angle y(2)
d#=50.0
h#=85.0
s#=50.0
set camera to follow x#,y#,z#,a#,d#,h#,s#,1
loop

Necrym
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: Australia
Posted: 4th Dec 2002 10:19
Look at the snippets on UW-designs website for collision with x object landscapes, you will probably have to make an array for the heights then it will work.
here is the link:
[url]www.uwdesign.50megs.com[/url]

Watch the bouncing cursor - now in 3d
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 4th Dec 2002 19:25
Thanx Necrym, I'll check it out.

Login to post a reply

Server time is: 2024-04-24 23:56:40
Your offset time is: 2024-04-24 23:56:40