topical media & game development
graphic-processing-site-examples-3D-Form-Icosahedra-Shape3D.pde / pde
abstract class Shape3D{
float x, y, z;
float w, h, d;
Shape3D(){
}
Shape3D(float x, float y, float z){
this.x = x;
this.y = y;
this.z = z;
}
Shape3D(PVector p){
x = p.x;
y = p.y;
z = p.z;
}
Shape3D(Dimension3D dim){
w = dim.w;
h = dim.h;
d = dim.d;
}
Shape3D(float x, float y, float z, float w, float h, float d){
this.x = x;
this.y = y;
this.z = z;
this.w = w;
this.h = h;
this.d = d;
}
Shape3D(float x, float y, float z, Dimension3D dim){
this.x = x;
this.y = y;
this.z = z;
w = dim.w;
h = dim.h;
d = dim.d;
}
Shape3D(PVector p, Dimension3D dim){
x = p.x;
y = p.y;
z = p.z;
w = dim.w;
h = dim.h;
d = dim.d;
}
void setLoc(PVector p){
x=p.x;
y=p.y;
z=p.z;
}
void setLoc(float x, float y, float z){
this.x=x;
this.y=y;
this.z=z;
}
// override if you need these
void rotX(float theta){
}
void rotY(float theta){
}
void rotZ(float theta){
}
// must be implemented in subclasses
abstract void init();
abstract void create();
}
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.