Jump to content
  • Advertisement
Sign in to follow this  
irbaboon

Terrain - map editor

This topic is 1500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been getting into 3D for a while now, and I'm using Bullet Physics for physics, and OpenGL 3+ for graphics.

Up until now, I've used Blender to create a map, and then load it to a btBvhTriangleMeshShape for use in Bullet. 

 

However, I want to create a map editor, and I first thought the easiest way would be to use a heightmap. This requires the entire terrain to be in a grid however, and that makes it hard to make good terrain without making a small grid full of unnecessary vertices. Therefore it seems like I can't use that.

 

I've tried Googling for resources on how I should go about this, but it's always topics which do not help me.

What I've been thinking about is to make the map in the editor a btBvhTriangleMeshShape, but I don't see any way to quickly modify vertices.

 

I hope anyone can give me some advice on what I should do.

 

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

I would go height map for a terrain editor. Bullet's height map object allows for the map array to be dynamically modified. Creating a new btBvhTriangleMeshShape every time the terrain is modified may or may not be too slow, but using the height map wouldn't require quite as much Bullet-related code.

 

On the other hand, do you really need physics *while* the terrain is being altered/extruded/etc? You could stop physics, allow the user to extrude (terminology?) a hill, and then start simulating again after building a new btBvhTriangleMeshShape. If your editor includes placing other objects (like debris), you might need to use an invisible sphere to push away other objects before creating a new btBvhTriangleMeshShape. Or even try to detect which non-static objects would need to be moved and just warp them above the new highest point in the area and let them fall back down (the user will have to re-place them, but hey, they rose a hill there).

 

Disclaimer: I've never written such an editor; I use Blender (poorly).

Share this post


Link to post
Share on other sites

I would go height map for a terrain editor. Bullet's height map object allows for the map array to be dynamically modified. Creating a new btBvhTriangleMeshShape every time the terrain is modified may or may not be too slow, but using the height map wouldn't require quite as much Bullet-related code.

 

On the other hand, do you really need physics *while* the terrain is being altered/extruded/etc? You could stop physics, allow the user to extrude (terminology?) a hill, and then start simulating again after building a new btBvhTriangleMeshShape. If your editor includes placing other objects (like debris), you might need to use an invisible sphere to push away other objects before creating a new btBvhTriangleMeshShape. Or even try to detect which non-static objects would need to be moved and just warp them above the new highest point in the area and let them fall back down (the user will have to re-place them, but hey, they rose a hill there).

 

Disclaimer: I've never written such an editor; I use Blender (poorly).

 

True, that is an advantage to using a heightmap. But it really limits how you can edit the vertices.

 

As for the triangle mesh method:

I suppose I can disable physics while editing, which would make it necessary to make a new class which has the vertices. The problem I can see with that, is I would need to reimplement certain features Bullet does for me, such as raycasting. 

 

Anyone else have any thoughts?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!