mirror of
https://github.com/processing/processing4.git
synced 2026-02-03 13:49:18 +01:00
Minor changes to examples, more code color tweaks for 2b8
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user