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.

DarkBASIC Professional Discussion / Polygon collision and get ground height.. does it work 4 u ?

Author
Message
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 26th Nov 2002 18:42
Not sure if its just me.. but.. 2 thinks for DBP (Patch 2 applied)..

I can't get polygon collision to work between any objects. I've tried objects exported (JT's DX8 exporter) from MS, the DM models and prims from DBP itself. I make the objects, set object collision on, set object collision to polygons. Move them into each other and (object collision 1,0) returns at zilch. Just read the Patch 3 contains a fix for low poly collision detection issues so hopefully its resolved, but I'm sure other people had it working not sure why I've not !

Also, get ground height.. may be me, or may be a matrix issue, but I get the reading from get ground height as accurate, but when I position the object y to the same value it jumps all over the place. My old get ground height demos, and CyberLukes car demo, and TMC's old car demo all behave weirdly.. anyone else have problems with get ground height ?

I'll be trying the above with Patch3 later. Neither has stopped me enjoying DBP, but thats becuase I'm in 2d heaved with hundreds of sprites buzzing around at an incredible rate.

Thanks
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 27th Nov 2002 00:07
Polygon collision is buggy. Nothing you can do mate! Hopefully patch 3 has sorted this. It's been messing me around too.

As for get ground height, that does work, but it's strangely offset. For example, get ground height(1,500,500) is probably getting the ground height for 100,100. So if you can figure out what the offset is, you can still make use of get ground height.

I think the bottom left corner of the matrix is where the matrix origin is, but get ground height assumes the matrix origin is in the middle of the matrix or vice versa. When you use get ground height, experiment with subtracting half the length or depth of your matrix from the value.

Eg.
you have a matrix of 1000x1000

You want to get ground height(1,600,600)

Instead try, get ground height(1,100,100)

Hope that helps.

Machine: P4 2200, 512MB, GeForce4 64MB, Audigy Platinum

There's a junglist inside every coder. http://www.kontact-kru.com for my own personal breakbeat terrorism.
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 27th Nov 2002 00:27
I just tried my test code again with Patch3 and the results are much better! Looks good to me now, cool. Here is the code for anyone who may want to see moving an obj over the matrix, controls (cursor left/right=rotate cursor up/down=forward/back).. enjoy.. (p.s. my polygon test is now working, but if I scale/move the .x it breaks the collision)

<code>
sync on:sync rate 100
box 0,0,39,39:get image 1,0,0,40,40
make matrix 1,100,100,10,10:randomize matrix 1,3:prepare matrix texture 1,1,1,1:update matrix 1
make object sphere 1,2:position object 1,50,0,50
do
x#=object position x(1)
z#=object position z(1)
y#=1+get ground height(1,x#,z#)
a#=object angle y(1)
position object 1,x#,y#,z#
if leftkey()=1 then dec ang,1
if rightkey()=1 then inc ang,1
if upkey()=1 then move object 1,0.5
if downkey()=1 then move object 1,0-0.5
yrotate object 1,wrapvalue(ang)
set camera to follow x#,y#,z#,a#,6,5,3,1
sync
loop
</code>
cypher
22
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 29th Nov 2002 08:29
Thanx a ton! I am a newbie, and this answered alot of questions for me!

cypher

Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 29th Nov 2002 19:22
Cool, glad it helped

Login to post a reply

Server time is: 2025-05-14 15:35:00
Your offset time is: 2025-05-14 15:35:00