title: Processing 3d object .obj import
body: <p>I'm trying to import 3d objects in Processing from .obj files found on the web. I've seen that there are several ways to import objs into the scene.</p>
  
  <p>I'm using PShape in this example and an obj file found  <a href="http://thefree3dmodels.com/stuff/architecture/medieval_huts_set/11-1-0-4682" rel="nofollow">here</a>. I've started from the Examples>Basic>Shape>LoadDisplayObJ sample in which textures work. </p>
  
  <p>I was able to import the obj file using the loadShape function but no textures and colors were displayed. Am I missing something? Should I import the .mtl file as well?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>PShape house;
  
  float ry;
  
  public void setup() {
    size(640, 360, P3D);
  
    house = loadShape("huts/huts.obj");
  }
  
  public void draw() {
    background(100);
    lights();
  
    translate(width/3, height/3, 0); 
    //rotateX(QUARTER_PI * 1.0);            
    rotateZ(-PI );
  
    rotateY(map(mouseX, mouseY, width, 2.5, -2.5));
  
    //rotateY(ry);
    pushMatrix();
    translate(1500,-400,0);
    shape(house);
    popMatrix();
   }
  </code></pre>