3d models, file or code?

Hey guys so I wanna ask a question about 3d again, what is more efficient for game maker, especially for reasonably complex models to load the model as a .d3d file or to create it in code for example:

model[2] = d3d_model_create();
d3d_model_primitive_begin(model[2], pr_trianglestrip);
d3d_model_vertex(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_vertex(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 150, 150, 200);
d3d_model_vertex(model[2], 100, 100, 0);
d3d_model_vertex(model[2], 100, 200, 0);
d3d_model_vertex(model[2], 200, 200, 0);
d3d_model_primitive_end(model[2]);


^ the models im using have arround 1000 lines of d3d_model_vertex

each room has a few (far more complex then above) model files, I am also using game maker 8.1 for reasons.... well the only reason is im trying to challenge myself and send gm 8.1 out with a bang you could say.

edit: hmmm now thinking about it this probably should have gone in the programming forum
 
M

MishMash

Guest
Well, a d3d model file will be more efficient, but it may not be significantly more. It many depend on how the internal importer works. Though it is far better to use models for neatness purposes.

The most efficient file format is to use vertex_buffers and save the vertex_buffer to a file (through the buffer interface). That way it can be directly imported in one single function. This is super fast as its really quick to load in a block of memory.
 
Z

zircher

Guest
I always find it easier to create the model and import that. Long lists of commands are murder to edit for me. I'm more concerned about a good pipeline than shaving milliseconds off the load time.
 
if this is your first game, then start by using d3d_model functions to understand how vertices work, and get the hang of normals and lighting (those are not always self-explanatory). Once this is done, you can go ahead and use models made with something else, as they're usually much prettier and easier to create.
 
Will do :) looked into verticies and its probably to much for my firsy decent 3d game in game makee tbh. I had to switch to d3d models as the scripts filled with the model code ended up pulling an out of memory error in the build process bit now that im loading and discarding the models when they are needed / not needed. Thanks for the response guys :) id say ive got a solid 2-3 months of work on my game before I release it to the community here :) no spoilers to what it is till it is released :)
 
Top