Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Implementing effecient camera bounding; spheres...any ideas?
Topic Started: Nov 18 2007, 11:08 PM (565 Views)
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
My game has reached the collision stage. I have searched around for a bounding sphere example, and have found none. Bounding spheres are pretty much a requirement for all modern 3d games. If we can put together a bounding sphere example, I think it would be beneficial to everybody. The thing that puzzles me, is how to detect whether or not something is in the sphere. I mean, using ray tracing, you would have to create about 360^2 rays, which would run the game at about 0 fps. Is sphere checking going to be included in U3d final? If so, is there a way to accomplish this before then? If not, there has to be some way of implementing this.
My second puzzlement is, how to check the normal of the plane that has intersected the sphere...

Finally, I just want to reiterate that without bounding spheres fully smooth, fully perfect, and fully 3d collision response just isn't possible. Here are some diagrams to show why:

Posted Image

Posted Image

Posted Image
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Use a physics engine. Wait for U3d 2.1. Find the Bullet Physics Engine to U3d topic on the GMC. Not impossible.

You have a defeatist attitude, dear sir.
Blog|EHS
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
skarik
Nov 18 2007, 11:57 PM
Use a physics engine. Wait for U3d 2.1. Find the Bullet Physics Engine to U3d topic on the GMC. Not impossible.

You have a defeatist attitude, dear sir.

Well sir, if I truly had a defeatist attitude, I wouldn't be trying to implement sphere collisions now would I. :)

What exactly is the Bullet Physics engine?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Well, basing on what I read on their site, it does exactly what you want with rays, or something like that. Someone on the GMC is trying to make it for Game Maker. If you ask me, that would be awesome, because then I can finish my trishot.

http://www.continuousphysics.com/Bullet/

Quote:
 
Well sir, if I truly had a defeatist attitude, I wouldn't be trying to implement sphere collisions now would I.

Good point. :rolleyes:
Blog|EHS
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Sounds somewhat complicated, but thats irrelevant because I can't use it anyway (it doesn't exist.) :P Btw, what is a trishot?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Eanbro
Nov 18 2007, 07:33 PM
Btw, what is a trishot?

It's U3d's equivalent of a gravity gun. :P Except awesome-r.

Quote:
 
Sounds somewhat complicated, but thats irrelevant because I can't use it anyway (it doesn't exist.)

Hmm. Have you used the box points way?
Posted Image

Doesn't work with spheres, but pretty good with bounding boxes. Of course, if you have no collision, you already have 24 rays if you're checking all directions.

What we need here is
Code:
 
distance_to_closest_face ( x, y, z );
Blog|EHS
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
I think you may have something there with your bounding boxes idea...but that distance_to_closest_face would trump all! :D
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Ruud v A
Member Avatar
Programmer · Artist
[ *  *  *  *  * ]
It depends on how important good collisions are, but you could use the 4 rays thing, but rotate the rays each step. That's 90 degrees, and if you rotate them with 2 degrees per step, it would take 45 steps to detect a collision in extreme cases. At 60 fps, this is less than a second, so for e.g. a camera it could work. I think Skarik's idea is better thoug, the image he showed might just work.

Veniogames
Vēnit, ut mē occidĕret.

I will not use Ultimate3d 2.x.x anymore - I am an Ogre C++ programmer.
Offline Profile Quote Post Goto Top
 
Bami
Member Avatar
Guess the character, win a prize
[ *  *  *  *  * ]
Why is everybody so exited to use Bullet physics?
Just use Tokemak, or ODE, or one of the gazillion engines already ported.

Tokemak and ODE work perfectly well with X3D, so I couldn't see why they shouldn't work with U3D.
Here are the thrill seekers, corrupt and immoral.
Posted Image
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
Ruud, in about a second I could traverse about 7 yards, a bullet could hit me from 1500 feet away, and fall 20 meters. Sorry to burst your 'collision bubble', but that rotating the rays each step isn't gonna happen :P

Bami-Which is easier, Tokamak or ODE? I may end up using those to accomplish sphere checking. Also, where can I find them?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Bami
Member Avatar
Guess the character, win a prize
[ *  *  *  *  * ]
Depends, both are pretty easy to learn if you get the hang of it.

I'm trying to make a little wrapper for Tokamak though, and since Macarraum was so kind to give the source to it, I can even update errors in it. Both engines are now opensource (tokamak just recently), and both use the BSD license, so license speaking there are no differences between them. I find that tokamak is a bit faster, and supports "materials", different surfaces have different friction values etc. I couldn't accomplish that in ODE.

Tokamak has been removed from Macarraums site, but he gave me permission to re-upload it.

download.bahmi.com
You can download a lot of crap there.

Oh, as far as I know, tokamak supports collision checking of meshes, but uses the .bin format, which is just tokamak specific. I don't know if I have a exporter or converter or something, but when I find one, I'll let you know.
Here are the thrill seekers, corrupt and immoral.
Posted Image
Offline Profile Quote Post Goto Top
 
Rixeno
Member Avatar
Teo-Carliss
[ *  *  *  *  * ]
Here, someone's trying to make a DLL from Bullet Physics, once it's done, you might get your wish (if he finishes it)
HERE
Report spam the nanosecond you see it.
Ninjas are everywhere, for all you know there are eleven behind you right now, including me...
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
"Here, someone's trying to make a DLL from Bullet Physics, once it's done, you might get your wish (if he finishes it) HERE"

yeeeaaahhhh...I kind of can't use it since it does not exist...

Bami
Nov 19 2007, 07:56 PM
Depends, both are pretty easy to learn if you get the hang of it.

I'm trying to make a little wrapper for Tokamak though, and since Macarraum was so kind to give the source to it, I can even update errors in it. Both engines are now opensource (tokamak just recently), and both use the BSD license, so license speaking there are no differences between them. I find that tokamak is a bit faster, and supports "materials", different surfaces have different friction values etc. I couldn't accomplish that in ODE.

Tokamak has been removed from Macarraums site, but he gave me permission to re-upload it.

download.bahmi.com
You can download a lot of crap there.

Oh, as far as I know, tokamak supports collision checking of meshes, but uses the .bin format, which is just tokamak specific. I don't know if I have a exporter or converter or something, but when I find one, I'll let you know.

yeeeaaahhhh...I kind of can't use it if it only uses some obscure format...
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Bami
Member Avatar
Guess the character, win a prize
[ *  *  *  *  * ]
Eanbro
Nov 19 2007, 09:32 PM
yeeeaaahhhh...I kind of can't use it if it only uses some obscure format...

it isn't obscure, you just need to go through a bit of trouble.

There is this program that converts a ascii table model to the .bin format. You just need to list the vertices in a list.

It's better then using 3ds or something, since that has a lot of added data.
Here are the thrill seekers, corrupt and immoral.
Posted Image
Offline Profile Quote Post Goto Top
 
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
eh...sounds like too much work, and I doubt it perfectly converts the model, how do you convert a DirectX. 8.0 file to ASCII table file?
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply