Wednesday, 1 October 2008

Here is finally a code which creates faces!

Light fitting tower






/*
import processing.opengl.*;
import oog.*;

Oog goo;

void setup(){
size(1000,600,OPENGL);
goo = new Oog(this);

Scene.drawAxis = true;
oog.Line.globalRender = new RenderPtsAll();

createForm();
}

Obj form;

void createForm(){
form = new Obj(); //Create an empty Object

oog.Line myList = new oog.Line();
oog.Line myList2 = new oog.Line();


int b=20;
int d=40;
int e=60;
//int h=50;
for(int h=0; h<600; h=h+50){

for(float c=0; c < TWO_PI ; c=c+(PI/b)) // division of a circle by b or number of dots on a floor
{

myList.add(Pt.create(random(d,e)*cos(c),random(d,e)*sin(c),h));
myList2.add(Pt.create(30*cos(c),30*sin(c),h+50)); //
}

//form.add(myList2);

for(int i=0; i {
Face myFace = new Face();

myFace.add(myList.pt(i));
myFace.add(myList.pt(i+1));
myFace.add(myList2.pt(i+1));
myFace.add(myList2.pt(i));


//println("i:" + i );

form.add(myFace);


}

}

goo.setCenter(form);
}

void draw(){
background(255);
form.draw();
}
*/

No comments: