How do I render bullet physics height fields?

Started by
3 comments, last by Steve_Segreto 6 years, 5 months ago

I looked one of the the bullet physics samples which talks about the topic in height field. But however, when the height fields get rendered, the "DemoApplication" class calls the opengl shape drawer object which finally retrieves the display list of the collision shape, which is strongly coupled to opengl, I want to do the same thing with DirectX (D3DX at the moment, damn old, but hey).. How can I draw the height fields out? Is there a way to turn the display list into something recognizable by Direct3D 9?
Thanks
Jack

Advertisement

if you have a height field wouldn't you need to generate triangles from it? http://bulletphysics.org/Bullet/BulletFull/classbtHeightfieldTerrainShape.html

you should be able to find a directx implementation of btDebugDrawer , if not it's easy enough to write one (I did it for XNA), as long as you implement the methods in the interface then bullet will do all the drawing for you (not just heightfields)

Check out this post, I provided a D3D9 implementation of a debug drawer you could use.

This topic is closed to new replies.

Advertisement