Checking is sides of cubes are solid

Posted by Christian Frantz on Game Development See other posts from Game Development or by Christian Frantz
Published on 2013-07-03T00:04:46Z Indexed on 2013/07/03 5:21 UTC
Read the original article Hit count: 339

Filed under:
|

In relation to this question: http://gamedev.stackexchange.com/a/28524/31664 And a question I asked earlier: Creating a DrawableGameComponent And also because my internet is too slow to get on chat.

I'm wondering how to check if the sides of a cube are solid. I've created 12 methods, each one creating indices and vertices for sides of a cube. Now when I use these methods, the cube creates how it should. All 6 sides show up and its like I didnt change a thing. How can use if statements to check if the side of a cube is solid? The pseudocode from the question above shows this:

    if(!isSolidAt(x+1,y,z))
            verticesToDraw += AddXPlusFace(x,y,z)

But in my case is would be:

    if(!sideIsSolid)
        SetUpFrontFaceIndices();

My method simply takes these index and vertex values and adds them to a list indicesToDraw and verticesToDraw, as shown in the answer above

© Game Development or respective owner

Related posts about XNA

Related posts about c#