Did not work.
I found that:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=LibraryProblems;action=display;num=1203516711;start=1#1
But i don't know, how to do it. I tried nearly everything.
Here is my sketch. it is a little messy. Have to clean up sometime.
Code:
import saito.objloader.*;
import processing.opengl.*;
import processing.pdf.*;
OBJModel model;
float rotX = 0;
float rotY = 0;
float transY;
float transX;
float transZ;
Vertex myVert;
PFont fontA;
float x;
float y;
float z;
float[] xCoords;
float[] yCoords;
float[] zCoords;
int letter;
boolean record;
char[] alphabet = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','&','$','!','@','1','2',
'3','4','5','6','7','8','9','0'};
char[] alphabet2 = new char[40];
void setup ()
{
size(600, 500, P3D);
frameRate(30);
model = new OBJModel(this);
model.load("test3.obj"); // dma.obj in data folder
calculateLetter();
for(int k = 0; k<40; k++)
{
alphabet2[k] = alphabet[int(random(39))];
}
}
void draw()
{
if(record) {
saveFrame("line-####.tif");
}
fontA = loadFont("UniversLTStd.vlw");
textFont(fontA,6);
background(51);
noStroke();
lights();
pushMatrix();
translate(transY, transX, transZ);
scale(1);
rotateX(rotY);
rotateY(rotX);
drawLetter();
popMatrix();
if(record) {
record = false;
}
}
void mouseDragged()
{
if(keyPressed) {
if (key == 'c'){
transX -= (mouseY - pmouseY) * 0.5;
transY += (mouseX -pmouseX) * 0.5;
}
else if (key =='x'){
transZ += (mouseY - pmouseY);
}
else {};
}
else{
rotX += (mouseX - pmouseX) * 0.01;
rotY -= (mouseY - pmouseY) * 0.01;
}
}
void keyPressed() {
if (key == 'r') {
record = true;
}
}
void calculateLetter()
{
xCoords = new float[model.getVertexsize()];
yCoords = new float[model.getVertexsize()];
zCoords = new float[model.getVertexsize()];
for(int i = 0; i<model.getVertexsize(); i++)
{
xCoords[i] = model.getVertex(i).vx;
yCoords[i] = model.getVertex(i).vy;
zCoords[i] = model.getVertex(i).vz;
}
}
void drawLetter()
{
letter = 0;
for(int j = 0; j<model.getVertexsize(); j++){
letter++;
pushMatrix();
translate(xCoords[j], yCoords[j], zCoords[j]);
if (letter >=39){letter = 0;}
rotateY(radians(90));
text(alphabet[letter], xCoords[j], yCoords[j], zCoords[j]);
rotateY(radians(-90));
translate(-xCoords[j], -yCoords[j], -zCoords[j]);
popMatrix();
}
}