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 / terrain collision with no matrix

Author
Message
Nathan C
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 13th Apr 2010 00:59
im trying to get terrain collision on my game. I want to be able to walk up hill so how can i achieve this? I've looked around the forums and none of this really makes sense.

heres my terrain code:
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Apr 2010 01:27 Edited at: 13th Apr 2010 01:30
Hi Nathan C. Have a look to get terrain height command.

cheers.

I'm not a grumpy grandpa
Nathan C
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 13th Apr 2010 02:45
That doesn't work, it says "terrain doesn't exists"
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Apr 2010 03:57
cuz it works !!...can you post your code? I will show you how to do it.

waiting!

I'm not a grumpy grandpa
Nathan C
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location:
Posted: 13th Apr 2010 04:19 Edited at: 13th Apr 2010 05:56


EDIT: you still there? lol
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 13th Apr 2010 10:05
Just your main loop, as thats where your problem is:



What that does is gets the camera position on X and Z, then uses that with the terrain height function to get the Y coordinate. Added 10.0 to the height value to raise the camera above the terrain.


Health, Ammo, and bacon and eggs!
chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Apr 2010 17:15 Edited at: 13th Apr 2010 18:32
Hi there.

@Nathan C
Van B has given you a complete example of how to walk on an advanced terrain.Yestarday night,(in canary islands), my wife call me finally...she do it from time to time and I didnĀ“t see your example until right now.

Here I show you how to walk and how to collide with the terrain(we don`t collide exactly...we just check if four points around us are higher than us, and then we stop in that direction).

Download the complete example.

cheers.



I'm not a grumpy grandpa

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-28 16:39:02
Your offset time is: 2024-09-28 16:39:02