Drawing a rigid body's path?
Posted: Sat Apr 22, 2017 11:20 pm
I have a first person shooter game made with Bullet and OpenGL, but I'm now trying to draw the path that my bullets take. They're the only moving body in my scene, and I'm aiming for something simple like a red line that draws from the body's starting position to its final position, and preferably this is only done on the last bullet fired so that the screen isn't filled with red lines. Basically, I'm looking for something that can draw a bullet's trail through the scene.
I'm asking here because I'm unsure about how to do this in OpenGL, and was hoping that Bullet provides some functionality for this (since Bullet has a debug drawer that draws rigid bodies, I was wondering if it has something that can draw a body's path...).
Failing that, since a few people use Bullet for these kind of games, does anyone have an example piece of OpenGL code that they've used for something like this?
Thanks in advance.
I'm asking here because I'm unsure about how to do this in OpenGL, and was hoping that Bullet provides some functionality for this (since Bullet has a debug drawer that draws rigid bodies, I was wondering if it has something that can draw a body's path...).
Failing that, since a few people use Bullet for these kind of games, does anyone have an example piece of OpenGL code that they've used for something like this?
Thanks in advance.