I am new to Bullet physics,Any how after a quick study I implemented broadphase collision detection. Now I want to implement narrow phase by means of ray casting. I referred the demo app on ray casting but i didnt understood any thing.
So can anyone briefly explain how to implement ray casting in a simple manner....
Thanks...
How To implement Ray Casting?
-
- Posts: 32
- Joined: Tue Feb 22, 2011 1:00 pm
Re: How To implement Ray Casting?
Hi,
actually this is not a trivial task. This is mostly something you must learn at university, in computer graphics. I doubt that someone will explain how to do it. The fastest way is to get a computer graphics book, the kind which explains how to construct a game engine, or image processing book.
I looked myself into the code of bullet demos, and what I understood is that there is a raycast from the camera to the 2D screen, testing the collision of the casted ray with the objects of the scene. this technique will not work if you must do a raycast from a 3D cursor in your world though.
Try to search on google books.
actually this is not a trivial task. This is mostly something you must learn at university, in computer graphics. I doubt that someone will explain how to do it. The fastest way is to get a computer graphics book, the kind which explains how to construct a game engine, or image processing book.
I looked myself into the code of bullet demos, and what I understood is that there is a raycast from the camera to the 2D screen, testing the collision of the casted ray with the objects of the scene. this technique will not work if you must do a raycast from a 3D cursor in your world though.
Try to search on google books.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: How To implement Ray Casting?
Are you looking for a 3D ray cast query? Did you try using the rayTest query using the dynamics world?
"I looked myself into the code of bullet demos, and what I understood is that there is a raycast from the camera to the 2D screen, testing the collision of the casted ray with the objects of the scene. this technique will not work if you must do a raycast from a 3D cursor in your world though."
The ray cast query in Bullet is generally in 3D, with a 'from' and 'to. Why would this not work?
Thanks,
Erwin
Code: Select all
virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
The ray cast query in Bullet is generally in 3D, with a 'from' and 'to. Why would this not work?
Thanks,
Erwin
-
- Posts: 12
- Joined: Tue Apr 19, 2011 6:02 am
Re: How To implement Ray Casting?
Thank U....XMight wrote:Hi,
actually this is not a trivial task. This is mostly something you must learn at university, in computer graphics. I doubt that someone will explain how to do it. The fastest way is to get a computer graphics book, the kind which explains how to construct a game engine, or image processing book.
I looked myself into the code of bullet demos, and what I understood is that there is a raycast from the camera to the 2D screen, testing the collision of the casted ray with the objects of the scene. this technique will not work if you must do a raycast from a 3D cursor in your world though.
Try to search on google books.
-
- Posts: 12
- Joined: Tue Apr 19, 2011 6:02 am
Re: How To implement Ray Casting?
Erwin Coumans wrote:Are you looking for a 3D ray cast query? Did you try using the rayTest query using the dynamics world?
"I looked myself into the code of bullet demos, and what I understood is that there is a raycast from the camera to the 2D screen, testing the collision of the casted ray with the objects of the scene. this technique will not work if you must do a raycast from a 3D cursor in your world though."Code: Select all
virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
The ray cast query in Bullet is generally in 3D, with a 'from' and 'to. Why would this not work?
Thanks,
Erwin
I was able to do ray casting...Thank you for the valuable information