Last Update Dec 15 2011
-Now faster than ever. THANK YOU X-tra Fear and score_under
-Merge GMK (Simple example and API definition)
-DLL, of course
-Source File... (Because I wonÃ¢Â€Â™t always be there) Sorry it's one HUGE c++ file...
Developed for GMModelFix, GMModelEx is a dll that encapsulates quite a few functions related to editing a model, Such as changing model point or facet range, color, alpha, vn, uv x, y, z. Generating vn light map, adding and removing facets, merging models, importing model and exporting them as d3d model files, Save model parts or fragment a model
However, it can be used in your game to mainly import obj or x files without using GMModelFix to fix your model (Though you really should use GMModelFix to make a real d3d model file). But it can also be used for other things...
GMModelEx is useful for
-Import obj and x files
-Save the imported model to d3d model or loop though the model data manually
-Morph the model data (Resize, Stretch, Rotate)
-Light Map generation
-Terrain mapping, e.g. getting the z value of a model at a point
-Morphing a model at run time, like destructible terrain, you need to save and reload using d3d_model_load
You can also loop though the data points to generate the gm_model, if the model is huge, saving and reloading may be faster
-Loading and converting a obj or x model to a d3d model...
Again you can save to a tmp file and d3d_model_load or loop through the point to make the gm model
You can map the 3d world to the model space and find the facet and facet points, for collision or terrain height map
-Fragment the model using RemovePoints or save passing a range to make model sub part, such as when destroying a model to bits
ALL feature allow for specifying a range of facets, so you can move the head off a body or save the body of a car without the wheels for example...
Remember, modifying the model data itself is only useful if you need to morph the model data; it's not a replacement to d3d_tranforms. you should use GMModelFix to make sure your model is pointing to the right, (+x), standing on the z axis (+z) so you have less d3d transforms in your game. GMModelFix should be the solution for most game that simply load and display a model as it converts obj and x models to d3d which is really all you need. But if you need total control (or make your own model editor), this is it.
Fixed the obj bug not including the last face or facet
NOW SUPER FAST
The dll can now populate a gm d3d model you created with
d3dmodel = d3d_model_create()
GMModelEx_ModelToGMModel(GMMODELEXModel, d3dmodel,0 /*or 1*/)
Which means your .obj and .x import is now crazy fast AND you can now basicaly morph your model live!!!
I have found a BUG with .obj exported by Anim8tor (or in my import of obj generated by anim8tor). When you export to a .obj, and import in GMModelFix, a facet will be missing. You can re-add the facet in GMModelFix if it's important... FIXED
GMModelEx_ModelSetPointAll BUG FIX you must change yourself to
//gmexport double GMModelEx_ModelSetPointAll(double model, double index, double x, double y, double z, double nx, double ny, double nz, double u, double v, color, alpha) //combines SetPoint and SetColorAlpha return GMModelEx_ModelSetPointColorAlpha(argument0,argument1,argument10,argument11) and GMModelEx_ModelSetPoint(argument0,argument1,argument2,argument3,argume nt4,argument5,argument6,argument7,argument8,argume n t9);;UPDATE
Removed clamping and MSVC
Edited by icuurd12b42, 11 September 2013 - 09:07 PM.