1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

3D 3d blender model help

Discussion in 'Programming' started by Dengar, Jun 7, 2018.

  1. Dengar

    Dengar Member

    Joined:
    Jun 21, 2016
    Posts:
    285
    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.
     
  2. Binsk

    Binsk Member

    Joined:
    Jun 22, 2016
    Posts:
    632
    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.
     
  3. Dengar

    Dengar Member

    Joined:
    Jun 21, 2016
    Posts:
    285
    thanks. tried both and still nothing.
     
  4. Dengar

    Dengar Member

    Joined:
    Jun 21, 2016
    Posts:
    285
    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;
     
  5. flyingsaucerinvasion

    flyingsaucerinvasion Member

    Joined:
    Jun 20, 2016
    Posts:
    2,224
    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: Jun 7, 2018
  6. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,840


    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.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice