These tutorials focus mainly on OpenGL, Win32 programming and the ODE physics engine. OpenGL has moved on to great heights and I don't cover the newest features but cover all of the basic concepts you will need with working example programs.


Working with the Win32 API is a great way to get to the heart of Windows and is just as relevant today as ever before. Whereas ODE has been marginalized as hardware accelerated physics becomes more common.


Games and graphics utilities can be made quickly and easily using game engines like Unity so this and Linux development in general will be the focus of my next tutorials.    



unsigned integer value








Which is then followed by the data for each vertex of the polygon:








texture index

horizontal texture scale

vertical texture scale

horizontal texture shift

vertical texture shift

texture rotation value

number of polygon vertices (three in this case)




x coordinate

y coordinate

z coordinate

u texture coordinate

v texture coordinate

Keyboard Controls


Not all of the keyboard controls have been added yet, though there are some for changing the camera and for camera movement, namely pressing C will switch between five different cameras in the perspective window and you can use the arrow keys with the pageup and pagedown keys to move the camera.


The numbers 1-9 and 0 are used to set the speed of camera movement 1 being the slowest and 0 being the fastest. The other keyboard controls are the escape key, which deselects any selected brushes and polygons, the space key which will reset the camera for the active window and the insert and delete keys will resize the grid. The H key will toggle the test mode which displays a wire frame view of the last carved brush and the G key toggles snap-to-grid.




The splines are used to set a path through the world for the camera to follow or for it to look at. At the top of the properties window you can use the drop down list to select the current spline to work with. Within the orthogonal windows, you can only manipulate the current splines control points. Next to this are two check boxes that set or clear the splines visibility and repeat properties. If the repeat check box is clear then the output point on the spline will only travel the spline once and then stop, otherwise it will repeat continuously. At the top left of the properties window you can set the color of the spline. On the left hand side of the properties window you can enter the degree of the spline and the number of control points it has, below these you can set the number of output points which is basically the resolution of the spline, the more output points the better the spline will look. Below this you can set the start and end times (in milliseconds) for the spline, the greater the time between the start and end times the longer it takes for the output point to travel the spline. On the right hand side of the spline properties dialog you can add, delete, save and load the splines, below these buttons you can cycle through the splines with a single click on the button marked current and do the same for the target spline below this. The target spline is the spline that the camera will look at when the camera is in 'follow' mode, which you can select by clicking on the (camera) mode button. The other two modes are 'free' which is the default camera mode and 'look', which means that the camera will travel along the current spline and look directly at the origin.


Static Lights


The static lights are used in the world loader/viewer to illuminate the world using light mapping. The static lights are represented in the perspective window as wire frame spheres and by circles in the orthogonal windows. You can move the static lights within the orthogonal windows by left clicking and dragging on the center control point or resize the lights diameter by left clicking and dragging on the control point on the circles perimeter. From the static light properties window you can select the current static light by using the drop down list near the top, next to this is a check box to set the current lights visibility state in the editor, this has no effect within the viewer as all lights are treated as visible. You can change the color of the light by clicking on the button next to the check box, this color is used within the viewer. Below the color button you can add, delete, save and load the lights. On the right of the properties window you can manually enter the position and radius values for the current light and also set the light brightness value. Setting the brightness of the light takes a bit of practice, but try setting the brightness to a overly high value to start with and then test them in the world, if the lights are brighter than you want you can then load the lights back into the editor to make the changes, if the brightness is set too low or the light is outside of the world then the polygons will not be illuminated.


Things to Note:


The textures are loaded automatically by the editor when the program starts, the program searches for any TGA images it finds in the textures folder, if you want to change the textures loaded at startup then add them to this folder before the program starts. The textures folder for the editor and the loader/viewer need to be identical for the correct images to appear when viewing the world.


With the splines and static lights you should load and have present at least one of each or the program may crash, just make them non-visible if you don't want to see them.


There is a small bug that I haven't tracked down yet that means that you can't select the build lines or static lights at the origin until at least one brush has been created, unfortunately that is my only clue as to what the problem may be, if the brush is deleted then you can select objects at the origin.


One problem is related to the removal of exterior polygons when the world is compiled. I have found that some of the exterior polygons are not being removed so this may upset the BSP process in the world loader, the workaround to this problem for now is to make sure the exterior of the world is a box shape before compiling and the easiest way to do this is to start with a solid box and carve out the rooms of the world but compiling and carving can take a lot longer due to the complexity of the brush.


When you come to export the world and you select the menu item it may take a while to respond, this happens because the program compiles the world before the save-as dialog appears, the same can also happen when carving a complex brush, it will appear as if the program has frozen, but it is working in the background. I'll have to add a progress bar with the next update.


There also appears to be more than one polygon per face left after some carves which sometimes results in the wrong polygon being rendered in the world loader.


Lastly, the world loader does not load worlds with a single room, it expects the world to partition into more than one area during the BSP process, I will fix these and any other bugs that I find before the next update.


I hope you find the editor useful, it desperately needs an undo for transformations and many other standard features, though it should be helpful if all you need is a simple world. If you have any problems or suggestions then send me an email or you can post to the Wiki below.