1
\$\begingroup\$

I'm using Velcro Physics (Formerly Farseer Physics) to make a game in XNA and I can't seem to figure this out.

I've decided to use MSTerrain for making my game's terrain because I wanted destructible terrain and MSTerrain seemed like the best bet. Unfortunately, I'm stumped on how to actually show the terrain. When I generate the terrain it's visible in debug view, but MSTerrain does not have a Draw method, so I'm wondering how it is supposed to be drawn to the screen? Is it worth pursuing?

I'm starting to think that MSTerrain is more trouble than it's worth, is there another better way to do this with bodies?

\$\endgroup\$
1

1 Answer 1

1
\$\begingroup\$

MSTerrain works by using the Marching Squares algorithm which expects a bit field to determine whether terrain exists or not. Normally you would pass in a black and white texture that defines where the terrain exists and then MSTerrain triangulates it. The handy part of this whole process is that you can then apply changes to this terrain and only have to rebuild those small parts.

Drawing an MSTerrain is left to the user as each terrain will likely be rendered differently. The most basic method would be to use the AlphaTest effect and use the texture that defines the terrain as the template for the graphical version of the terrain. This would allow holes and chunks to be changed without changing the initial graphical representation of the terrain.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .