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 / Collision with complex .x object?

Author
Message
MikeB
17
Years of Service
User Offline
Joined: 5th Apr 2007
Location: My Computer, Shropshire, England
Posted: 23rd May 2007 14:22 Edited at: 23rd May 2007 14:25
Hi, I have sparky's dll, but I havn't used it yet.

I have re-created the pacman maze, in 3d, but it is all one object.

I have a sphere, which moves using move object and move object left/right.

It starts in an area that solid parts of my model are NOT in, but it is still inside the bounding box.

I did a simple test using this code.

If object hit(1,2) then color object 1,rgb(0,255,0)

My sphere is instantly green.

How would I make it so it.... well..... works properly .

Oh yeah, and how do I code it so that (e.g) the object is NOT colliding with object 2, it does something.

In game maker you just put

E.D.

Veron
18
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 23rd May 2007 14:32
You can do it the same way as it is done in GM.


[center]
MikeB
17
Years of Service
User Offline
Joined: 5th Apr 2007
Location: My Computer, Shropshire, England
Posted: 23rd May 2007 16:17
But if I do

it just says could not determine paremeter type of !Object hit(1,2)

And if I remove the ! then it doesn't have that error.

E.D.

RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 23rd May 2007 19:20 Edited at: 23rd May 2007 19:22
Veron... no. Completely wrong.

Anyways, do a search for "Collision" on the forum eldest, you'll see a thread by me named "Massive Collision Resource". Click on it and you'll have a tonne of collision threads / code snippets.

Collision with complex .x objects requires raycasting, the most popular 3d collision technique. DBP has its own raycasting command (INTERSECT OBJECT), but downloading sparky's dll (you can find a link in that thread) gives you access to a faster raycasting command, along with a tonne of others, that make sliding or bouncing collision in a 3D world extremely easy.

From the massive collision resource, you might wana check out the sliding collision function using sparky's dll I made (I link to it from there under the "plugins code snippets" section. Its almost a plug n' play function, just put it in your program, call it with the correct parameters, and you'll have sliding collision, hopefully.

Be sure to look at all of the example programs that come with sparky's dll before trying to use it for yourself, to understand whats needed.

<edit>

Heres the link to the massive collision resource

MikeB
17
Years of Service
User Offline
Joined: 5th Apr 2007
Location: My Computer, Shropshire, England
Posted: 23rd May 2007 22:31
Wow thanks so much .

E.D.

Login to post a reply

Server time is: 2024-11-25 17:33:30
Your offset time is: 2024-11-25 17:33:30