- WaveFront .obj
- Anim8or .vtx
- C source files .c (as exported by LithUnwrap)
- DirectX files .x (only in ascii/non compressed)
- 3D Studio ASCII files .asc
- GameMaker .mod (as loaded and saved by the builtin GM3D model loading/saving routines)
d3d_model_load_ext() reads all vertex, texture and normals data (if available in the file).
It has parameters to make it easier to use the model in GM, you can:
- flip the normals
- mirror the texture coordinates
- set a scale (because d3d_transform_add_scaling(xy,ys,zs) distorts the normals)
Download
Download the script and demo project, .gmk
hotlink-hosted on Dropbox
Usage
Loading a model works the same way as with d3d_load_model(), with three additional parameters:
model=d3d_model_create(); d3d_model_load_ext(model, fname, flipnormals, fliptexcoords, scale);(TODO: Make parameters optional)
The model can then be used in the Draw Event:
d3d_model_draw(model,x,y,z,texture);
Additioal Information and Licensing
d3d_model_load_ext() is a freeware script and you may well redistribute the package as it is.
Some parts of it took me hours to develop/figure out/research.
If you use it in your projects, please give credit to me like:
"Uses d3d_model_load_ext() by Paul "Master Xilo" Frischknecht"
Created for model formats as exported by LithUnwrap 1.3, but should work for files created by any exporter.
If it doesn't, try reconverting your model using the above program.
Remember that loading Game Maker's .mod 3d model format is always the fastest. Convert other formats only once and save them as .mod if possible. If you want to load .mod files even faster, check out d3d_model_load_fast.
I hope you'll find this script useful.
- Paul
Edited by Master Xilo, 21 July 2012 - 11:54 AM.











