the script for such a developement begins probabeli like that..
import oog.*;
import processing.opengl.*;
Oog myScene;
Obj myObj;
Sliders mySliders;
Pt[] ref;
void setup() {
size(800, 400, OPENGL);
myScene = new Oog(this);
initForm();
}
void initForm() {
myObj = new Obj();
Scale s = new Scale(0.5);
Obj module = createModule();
for (int i=0; i<5; i++) {
Scale e = new Scale(0.5);
Translate b = new Translate (10,0,10);
Translate c = new Translate (0,10,10);
Translate d = new Translate (10,10,10);
Obj myCopy = new Obj(module);
Obj myCopyb = new Obj(module);
Obj myCopyc = new Obj(module);
Obj myCopyd = new Obj(module);
myCopyb.apply(s);
myCopyb.apply(b);
myCopyc.apply(s);
myCopyc.apply(c);
myCopyd.apply(s);
myCopyd.apply(d);
myCopy.add(myCopyb);
myCopy.add(myCopyc);
myCopy.add(myCopyd);
myObj.add(myCopy);
module = myCopy;
}
myScene.setCenter(myObj);
}
Obj createModule() {
int edge = 40;
int h = 9;
etc
mercredi 22 octobre 2008
mercredi 1 octobre 2008
lundi 29 septembre 2008
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
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
mercredi 24 septembre 2008
Inscription à :
Articles (Atom)





