Skip to content

Instantly share code, notes, and snippets.

@echophon
Last active June 9, 2017 00:55
Show Gist options
  • Save echophon/8d3dbbff0c0198ab63bb2194d8d703e4 to your computer and use it in GitHub Desktop.
Save echophon/8d3dbbff0c0198ab63bb2194d8d703e4 to your computer and use it in GitHub Desktop.
import wblut.processing.*;
import wblut.hemesh.*;
import wblut.geom.*;
import wblut.math.*;
HE_Mesh mesh;
WB_Render render;
int frames = 120;
float t = 0.0;
void setup() {
size(1000, 1000,P3D);
smooth(8);
render=new WB_Render(this);
}
void draw() {
background(55);
t = ((float)(frameCount%frames) / frames) * TWO_PI;
HEC_Box creator = new HEC_Box();
float size = 200 + (50*sin(t));
creator.setWidth(size).setHeight(size).setDepth(size);
mesh = new HE_Mesh(creator);
pushMatrix();
translate(width/2, height/2, 0);
rotateX(sin(t)*0.5);
rotateY(cos(t)*0.5);
stroke(0);
render.drawEdges(mesh);
noStroke();
render.drawFaces(mesh);
popMatrix();
if (frameCount <= frames){
saveFrame("frames/image-#####.png");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment