Physics Simulation Forum


All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Sep 05, 2010 6:44 am 

Joined: Tue Dec 25, 2007 1:06 pm
Posts: 456
I've modified the code of the appRaytracer demo included in the Bullet (2.76) distribution, and I've made this new raytracer demo.

The .exe included in the zipped archive has been built with the VC++ 2008 compiler, using the /MD option, and so needs the VC++ 2008 runtime to be installed on your system in order to run.
Compiling the code is very easy, since all the files and project options can be copied from the original appRaytracer demo: the only difference is that the (two) .cpp files are in the folder inside the .zip archive.

You might find a similiar raytracer useful if you need to build some kind of collision shape that's not correctly displayed (with enough approximation) by the Bullet default openGL renderer (or by other renderers as well); that's why I thought it was worth sharing it with the Bullet community.

-> camera can be moved using the usual camera keys.

-> the raytracer uses a parallel projection: it's not as good as a perspective projection, but in this way:
a) the ray direction is the same for all rays and can be calculated once.
b) the rays don't diverge, so even at low resolutions, a lot of them hit the target.
-> the openGL texture is a GL_LUMINANCE texture, so that the texture buffer is 2/3 smaller.
The code hasn't been written with speed in mind and there are plenty of further optimizations that can be done (like using multiple cores/threads, etc.).

ortho_raytracer_demo.jpg [ 5.94 KiB | Viewed 3105 times ]

Attachment: [211.37 KiB]
Downloaded 321 times

Hope you like it.

P.S. I've included an experimental btCollisionShapeGarbageCollector class, but please don't rely too much on it. I made it in ten minutes and so it lacks testing/fixing and must contain several errors for sure.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group