Hello!
I'm trying to build a geometry like a circulation.
The idea is to get some floors that follows a circulation in star.
My code for such a line is:
import oog.*;
import processing.opengl.*;
Oog goo;
Obj myObj;
void setup() {
size(1200, 800, OPENGL);
goo = new Oog(this);
Scene.drawAxis = true;
oog.Line.globalRender = new RenderPtsAll();
initForm();
}
void initForm() {
//Create a new Object to store our shape
myObj = new Obj();
int demiL = 100;
int numOfSides = 5;
int numOfLoops = 10;
float theta = 2*PI/(numOfSides);
// starting point
Pt a = Pt.create(demiL,demiL*tan(2*PI/20));
Pt b = Pt.create(-1*demiL,demiL*tan(2*PI/20));
oog.Line myLine =new oog.Line();
Translate t = new Translate(0,0,10);
RotateZ rot = new RotateZ(theta);
for (int i=0; i<(numOfSides/2)*numOfLoops; i++){
a=Pt.create(a);
b=Pt.create(b);
a.apply(rot);
a.apply(t);
b.apply(rot);
b.apply(t);
myLine.add(b);
myLine.add(a);
goo.sliders(myObj);
myObj.add(myLine);
}
}
public void draw() {
background(153);
myObj.draw();
}
I don't know if it's a good way to think in that way, but I find this geometrie very interesting
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire