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 / Inside out sphere collision thingy

Author
Message
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Sep 2003 03:03
I thought if you turned a sphere inside out, you could use collision detection on the inside?

Just tried it, and I get collisions detected whether it's inside out or "normal". I set Collision detection to Sphere.

Anyone fill me in on how I get it right?

Damokles
21
Years of Service
User Offline
Joined: 28th May 2003
Location: Belgium
Posted: 14th Sep 2003 11:36
I would try it mathematically :
Calculate the distance between the object and the center of your sphere, and if it is larger than the radius of the sphere, then you shall put what happens when it collides

"Begin at the beginning, and go on till you come to the end: then stop." - Lewis Carroll
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 14th Sep 2003 11:43
well x^2+y^2+z^2=1 is any point on the surface of a sphere IIRC (bit rusty on this ), so where x^2+y^2+z^2<1 then thats inside the sphere, and where its greater than 1 then you are outside the sphere, of course your position for the center of the sphere would have to be 0,0,0, or you could deduct the offset and add it in again after, I think thats right, but it might be wise to wait for someone with better math skills to confirm that (I`ve only been up 10 minutes ),cheers.

Mentor.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Sep 2003 13:15
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Sep 2003 15:37
SET OBJECT COLLISION OFF on your sphere, then you can use the standard distance calculations to check for collisions with the sphere if you need to.

Login to post a reply

Server time is: 2024-09-21 01:06:13
Your offset time is: 2024-09-21 01:06:13