I'm a gameplay programmer
focused on developing
engaging and unique experiences!

My Resume Learn more

Assignment 06

One of the core parts of a game engine is being able to read in external files to alter in game objects. We've already been doing this with effects, but this assignment had us apply the same idea to meshes. Eventually, this will allow us to import meshes from external programs like Maya!

The result appears to be almost entirely the same to Assignment 05, however behind the scenes meshes can be changed by simply editing an external file rather than the code! Try it out here!

The controls are the same as last time where you can move the camera forward/backward by using the Up/Down Arrows and Left/Right using the Left/Right Arrows. You can also move the white triangles Up/Down using the W/S keys and Left/Right using the A/D keys. Finally, you can also switch out the white triangles with a single white triangle by holding the Shift Key.

Human-Readable Asset

Here's the human-readable asset that represents a triangle mesh now:

return
{
    vertexArray =
    {
        {
            position = { 0, 0, 0 }
        },
        {
            position = { 0, 1, 0 }
        },
        {
            position = { 1, 1, 0 }
        },
    },

    indexArray =
    {
        0, 1, 2
    }
}

The layout of this file was focused on readability rather than parsability. This makes it easier to debug and understand by anybody looking to use our format. The format is a little targeted towards users with a basic understanding of graphics, where we have explicitly declared a vertex array to hold several positions with implied x, y, and z values by their ordering. There is also an index array to indicate which vertices will be used to create triangles.

No Comments Yet.

Leave a comment