v1.0 [6th Feb 2011]
OVERVIEW |
Heditor is a super-simple 3D modelling tool which outputs it's models as C header files. This allows models to be imported into C, C++ and Objective-C programs with no tool chain and no need for any model loading code. Apart from the compulsory 3D modelling feature of creating triangles and moving them about, the only other trick that Heditor has is a nice smoothing algorithm. Create a control mesh with a small number of triangles, set smooth weights for your vertices, and the editor will generate low, medium, and high LOD (level-of-detail) versions of your model automatically. All three LODs are output in the header file. Heditor doesn't have common modelling features like materials, animation, or texture mapping. But simplicity is it's purpose. I've released Heditor because I think people making OpenGL or DirectX 3D applications who just want some damn models in the game already might find it really useful. If you're building a game prototype or coding up a tech demo, you can use this program to have a low or high-poly models in your program without thinking about model loading libraries, asset directories, or tool chains.
| ||||||||||||
QUICK START |
Heditor takes the filename it uses for loading and saving as it's first command line parameter. I've included a model with the editor as an example. So if you want to work with this "kren" model file, you could create a shortcut to Heditor, right click it and in it's properties alter the end of the Target line to read \Heditor.exe kren .When you run that shortcut the kren model will load on startup. Use the mouse to look around, and the mouse buttons to fly forward and backward. The program will start up in "Control Mesh" mode which is the main editing mode. In this mode there are two ways to create a triangle: point your mouse at the grey grid and press [C] to create a horizontal triangle, or point your mouse at the edge of an existing triangle and press [V] to create a pair of vertical triangles. Controls are shown on the left of the window. Most of these are context sensitive and only light up when they can be used. Some commands (move, rotate, mirror, duplicate) only operate on triangles that are fully selected. You'll soon realise that all vertices in the control mesh will always lie directly above a vertex in the grid. The reasons for that have more to do with the nature of the game I originally made this editor for. It's an unusual restriction but it's never stopped me from creating the models I imagined. When you perform a save, the editor will save THREE files: filename.h - this is the file you'll want to #include into your game or project.
filename.edit - this is the file which Heditor will load should you want to edit the model in the future.
Archive/filename_YYMMDD_HHMM.edit - the program automatically makes archived backups of the .edit in this directory, and names them with the date and time.
HEADER FILE |
The header file can be #included in any C program. The first three numbers it defines are the number of triangles in each of the three LODs of the model. | What follows this is three massive arrays of floats. These look harder to work with than they are, so bare with me. Each line here is a triangle. The numbers are:
What you'll want to do is cast these arrays. Create a structure using your 3D vector class or struct something like this...
In C++ you can now cast an array like so:
Hey presto! You now have a pointer to a model with triangles and vertex normals preloaded into memory and set up with your own 3d vector structure. This
You can process this into another structure and apply transformations or add data if you want. Alternatively in DirectX you can just set your FVF to
EDIT FILE |
The .edit file is Ascii and describes the Control Mesh model only. If you're making a project for another programming language I guess you could load up that .edit file to get a low lod model. In case that's something you're interested in, here's the .edit file format. The first five numbers are: | Number of Triangles, Not Used, Pivot X, Pivot Y, Pivot Z After that, each line is a triangle. You can see these lines are spaced in three groups; each one is a vertex. The numbers for each vertex are: X, Y, Z, Smoothing Factor, Not Used
TIPS |
| BACKGROUND |
Originally, Heditor was written solely to provide models for my game Substream. I threw the editor together in a couple of weeks, with only the few features I needed for that particular game. The original Heditor I use to make Substream models has a few more features than this version but they were very game specific so I pulled them out to simplify the header file format. |
AUTHOR |
I'm happy to answer any questions about this program, or if you make something interesting with it let me know. |
E-mail: mail@benbradley.com
OH, BTW |
You're free to use any models made with this program in any project, commerical or not. Feel free to redistribute the program but please include this document so people know where it came from and can get help/updates.
| |