Minor changes to examples, more code color tweaks for 2b8

This commit is contained in:
Casey Reas
2012-12-20 03:21:07 +00:00
parent cebf10855e
commit 234cbdd85f
13 changed files with 114 additions and 138 deletions

View File

@@ -44,8 +44,8 @@ void draw() {
}
class Pelo
{
class Pelo {
float z = random(-radio, radio);
float phi = random(TWO_PI);
float largo = random(1.15, 1.2);

View File

@@ -8,29 +8,30 @@
float xmag, ymag = 0;
float newXmag, newYmag = 0;
void setup()
{
void setup() {
size(640, 360, P3D);
noStroke();
colorMode(RGB, 1);
}
void draw()
{
void draw() {
background(0.5);
pushMatrix();
translate(width/2, height/2, -30);
newXmag = mouseX/float(width) * TWO_PI;
newYmag = mouseY/float(height) * TWO_PI;
float diff = xmag-newXmag;
if (abs(diff) > 0.01) { xmag -= diff/4.0; }
if (abs(diff) > 0.01) {
xmag -= diff/4.0;
}
diff = ymag-newYmag;
if (abs(diff) > 0.01) { ymag -= diff/4.0; }
if (abs(diff) > 0.01) {
ymag -= diff/4.0;
}
rotateX(-ymag);
rotateY(-xmag);