3D 3d blender model help

D

Dengar

Guest
im using gamemaker studio 1.4 and blender models using this addon for blender http://martincrownover.com/blender-addon-gm3d/ to convert the model into a .txt file that I'm using as a script. everything looks right to me but nothing is showing up ingame.

below is the code im using
Code:
//create event
model[0] = test_model();
Code:
//draw
d3d_model_draw(model[0], x, y, 0, sprite_get_texture(spr_Wall,0));
Code:
//test_model() script
var temp = d3d_model_create();
d3d_model_primitive_begin(temp,pr_trianglelist);
d3d_model_vertex_normal(temp, -1.000000, 0.602819, -0.011654, -0.577349, 0.577349, -0.577349);
d3d_model_vertex_normal(temp, -1.000000,
.......
d3d_model_vertex_normal(temp, 0.087392, -0.839538, 1.039895, 0.574999, -0.564165, 0.592486);
d3d_model_primitive_end(temp);
return temp;
theres something like 5k lines of d3d_model_vertex_normal so Im just showing the beginning and end of the script.

the camera is controlled by another object and everything works ingame except this model doesn't show up. I'm using walls and blocks right now. theres no errors,i'm just not seeing the model ingame. any help would be appreciated. a friend of mine is doing the modeling, im just the programmer.
 

Binsk

Member
Try disabling culling and check the scale of the model (maybe it's just really tiny). It does look like the model size is extremely small from the vertices you have provided.
 
D

Dengar

Guest
Try disabling culling and check the scale of the model (maybe it's just really tiny). It does look like the model size is extremely small from the vertices you have provided.
thanks. tried both and still nothing.
 
D

Dengar

Guest
instead of using the model script that I got from blender I copied the one from the manual and it doesn't show up ingame either.
im new to 3d, so please point out anything im doing wrong.

Code:
//copied from manual
var m = d3d_model_create();
 d3d_model_primitive_begin(m, pr_trianglelist);
 d3d_model_vertex_normal(m, -128, 0, -48, 0, 0.5, -0.5);
 d3d_model_vertex_normal(m, -128, 96, 48, 0, 0.5, -0.5);
 d3d_model_vertex_normal(m, 128, 0, -48, 0, 0.5, -0.5);
 d3d_model_vertex_normal(m, 128, 0, -48, 0, 0.5, -0.5);
 d3d_model_vertex_normal(m, -128, 96, 48, 0, 0.5, -0.5);
 d3d_model_vertex_normal(m, 128, 96, 48, 0, 0.5, -0.5);
 d3d_model_primitive_end(m);
 return m;
 
There are lots of different reasons why things might not show up correctly in 3d. Too many reasons to really list them all. Your camera might be in the wrong location or pointed in the wrong direction, or your camera might not exist, or your view's up and look directions might be parallel, or your fov or aspect might be zero, or your near clipping distance might be zero, or your far clipping distance might be equal to your near clipping distance, or the thing you are trying to draw might be drawn in the wrong position, or outside your camera's clipping planes, or using the wrong shader, or might have the wrong vertex attributes, or its vertices might have the wrong winding order, or drawn the same colour as your background, or onto the wrong surface, or might not exist, or might have zero scale, or something might be drawn over them, etc, etc...

Can you get anything to show up in 3d at all?
 
Last edited:
I

icuurd12b42

Guest

Here's 3d a setup guaranteed to work, basically 3 lines of code for the camera, you can start from there to debug your model before adding a true first person 3d camera, if that is your goal.


As for that blender tool to make models. if it makes d3d file you should make d3d files instead. gms1.4 cannot display large code...

You can also use my gmmodelfix, link in my tool page, which is by far a much better tool to convert obj files to models compatible in game maker.
 
Top