Please wait, sending information.

OpenGL Game Engine - C++, FBX SDK (2013)


Graphics projects montage. Just some history on my graphics projects.

This is the current state of the game engine, version 2. It supports loading an NWN model. The frame rate is kind of low, but just switching from visual studio 2010 to vs2012 made a big difference ~500 to 1300. I still have a lot of code optimization to do, but that's not the current focus. Features first. There's a long list of classes in the design that need implemented.

Source code: GitHub


This is an overview of the class structure that this project is moving towards. Currently, only 40% or so has been implemented and is denoted by the coloring. Red is tasked to be worked on and yellow is implemented but not complete.

Class Diagram



Played around with using threads to load the assets. For some reason it is over writing data. I've gotten rid of all the memcpy and malloc. I only use new. Not sure what the issue is, needs further investigation. * it's the stl vector class, it isn't thread safe.


Finally got version 2 to a fully functioning state. It now loads a game asset from Never Winter Nights: I got stuck loading the animation, which I finally figured out that the printAnimation function was inside a zeroing of the mesh (to get the relative location of the verts). Once that was fixed, it all works. Now it's actually on to the GameObjectType. This is the easy part since I've done all of that code for the 2d engine. The hurdle after that will be to optimize all the code.


It now passes test 7, which consists of animation, grouping, and a bunch of matrix math. This one needed math on the matrices to get animation working. Currently the animation frames are baked so every frame has a matrix. But due to the group constraint from test 5, there were some issues. 3ds max was outputing absolute matrix transform for the group and a relative transform from the last frame for all objects in or out of a group. So I had to figure that out first then changed the data to be all relative and then I needed to implement matrix math to allow for the frame addition(multiply) to the base matrix. And that all now works. So it's on to the Game Object type. The Game Object is the "item" in the uml diagram. It's the object to control all the models interaction, whether it be physics, AI, or user input.


It now passes test 3, which consists of texture mapping. Working on animation...


The system now passes test 1 & 2. 1 was supposed to be just the alignment with the axis. Test 2 was supposed to be testing physical objects in the world, i.e. a box. The 3rd test was supposed to be texture mapping but I needed lights and camera to make the scene work. Which are not even part of the tests (lights and cameras). So I guess test 1 is objects, lights, and cameras. Which it now passes, it's a one to one with 3ds max on lights, Cameras, and objects. On to test 3, texture maps.


ok, so I'm an idiot. It took me to long to determine that 3ds Max uses absolute positioning for it's vertices. So now it works without translations/rotations/scale or the transform matrix. Still having an issue with the camera thought. If I get hte translations/rotations/scale it's actually missing the rotation part. Maybe the Camera I'm using. If I use the transform matrix it messes up the entire screen. So, that's next on the list.


Ok so my guess on the inverse function of maxscript was wrong. I wrote my own code and that created the same results. So, I'm not sure what I'm missing as to the issue translating the 3ds Max matrix to OpenGL. I've tried changing the algorithm by removing the inverse function, Manipulating the multiply by matrix. The manipulation of the multiply by matrix seems to work the best, but I can't get the z axis to align. That's why I thought the inverse messed things up. Well, I need to do some reading...


3ds Max Ref  OpenGL Render

The new Engine is up and running but I've been trying to figure out the export from 3ds Max to xml to opengl. I discovered that MaxScript's inverse function breaks the matrix, because they use a 3x4 matrix. So, I'm currently working to build an inverse function in max script for a 4x4 matrix.


Starting a new version. You might be asking, Why am I doing this again? It works, Yes, that code works. But it doesn't read biped from 3ds max. So I needed a way to see the data structures from 3ds max. So I created an xml exporter. Most of the code is copied from the first version, but there were some needed changes that I'm making in this version. Hence the UML diagram. Eventually I'll create or copy the fbx importer into this version along with other file formats.


This is version 1 of the game engine. I've learned a lot from it and it was time to get the thing started in the right direction. In other words, focus on making a game engine instead of just one feature at a time.
Note: This seems to only work on Windows XP - for some reason vector, list runs out of memory while allocating space for the point data on Windows Vista and Windows 7 if ran outside of the debugger.

Also this is trial and error code. This is not a representation of my c++ style of coding.

Source Code
Latest Release