Terrain

General discussion about Box2D tutorials
Post Reply
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

Terrain

Post by vkreal »

iforce2d do you have any plan for advance topic on Terrain. It would be interesting to see how to implement endless Terrain.

Thanks!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Terrain

Post by iforce2d »

Yes probably sometime I will. Ray Wenderlich has a pretty good tutorial about that, you could check that one out. I think he uses polygons whereas I would prefer chain shapes though, because they do not have the sticking in the ground problem, and you can easily make concave shapes.

I think the typical approach is to generate discrete chunks of terrain that can be loaded and destroyed on the fly, and you would want to make sure the edges of the chunks match up. This can sometimes cause issues with stuttering as each chunk is loaded, if the chunks are too large. If you wanted to, you could load individual edges and set their ghost vertices, that should eliminate the stuttering problem.
Post Reply