OBJ Loader Model not Showing up

edited December 2015 in GLSL / Shaders

Hi people! I've been following the OBJ loader library to load 3D models from blender following this tutorial:

But, all I'm getting is a black silhouette instead of the 3D model. I've used blender render to export the objects and followed the instructions in the video. Anyone have any suggestions? Untitled

Answers

  • Not an expert in 3d, but did you try to add lights to your sketch?

  • Thanks for the reply. Yes, I have lights() in my draw() loop.

  • edited December 2015

    Look at shape or so - you can disable the own texture of the obj

  • edited December 2015

    So use Shape() to draw it? The original shape from blender has no texture.

  • use shape to draw it

    Disable texture before that and say fill(255,0,0); before that

  • Shape() doesn't take a model object as an argument it only takes PShape. fill didn't make a difference, here is my code for reference:

    import processing.opengl.*;
    import codeanticode.glgraphics.*;
    import saito.objloader.*;
    
    
    OBJModel model;
    
    void setup()
    {
      size(800,600,P3D);
      model = new OBJModel(this,"rocks.obj");
      model.scale(180);
      model.translateToCenter();
      //noStroke();
      //lights();
    }
    
    void draw()
    {
      background(200);
      lights();
      translate(width/2, height/2, 0);
      //rotateY(PI/2);
      fill(255,0,0);
      model.draw();
    } 
    
  • does it look good now?

    Disable texture before that and say fill(255,0,0); before that

  • How do I disable texture?

  • edited December 2015

    disableStyle() only works for a PShape. OBJ loader uses a 'model' object. As far as I know there is no way of converting one to the other. Does the code run ok on your machine? If it does it might be my graphics card.

Sign In or Register to comment.