We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi! I'm trying to import a 3d object into processing. I have the obj file (and exported in stl binary format with Rhino) and I'm trying to import it into a toxic lib triangle mesh. What I get is not What I'm expecting.
Here is my object seen in Rhino:
This is my processing code (done inside Eclipse):
import processing.core.PApplet;
import toxi.geom.Vec3D;
import toxi.geom.mesh.STLReader;
import toxi.geom.mesh.TriangleMesh;
import toxi.processing.ToxiclibsSupport;
public class Main extends PApplet {
public static void main(String[] args) {
PApplet.main(new String[] { "Main" });
}
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);
}
}
This is what I see when I run the sketch:
Answers
Resolved. It was only a scale problem!
Hi, I am testing your code with my STL file but i don't know why it becomes like this. I didn't add any colorful things in the model actually. Could you please tell me what goes wrong ?
Solved