Import STL file using Toxiclibs

edited February 2015 in Library Questions

I am using Toxiclibs and I can successfully import STL file but something goes wrong. As you can see the pic, I didn't add any colorful things in the model. Can somebody tell me what is wrong? QQ20150213-1

import processing.core.PApplet; import toxi.geom.Vec3D; import toxi.geom.mesh.STLReader; import toxi.geom.mesh.TriangleMesh; import toxi.processing.ToxiclibsSupport;

ToxiclibsSupport gfx;
TriangleMesh mesh;

public void setup()
{
    size( 800, 600, P3D);
    gfx = new ToxiclibsSupport(this);
    mesh = (TriangleMesh) new STLReader().loadBinary(
            sketchPath("bumps_deformed.stl"), STLReader.TRIANGLEMESH);
}

public void draw()
{
    background(151);
    lights();
    translate(width/2, height/2, 300);
    rotateX(mouseY*0.01f);
    rotateY(mouseX*0.01f);
    gfx.origin(new Vec3D(), 100);
    noStroke();
    gfx.mesh(mesh, true, 10);
}

Answers

Sign In or Register to comment.