Skip to content

Commit 830113a

Browse files
committed
Example updates
1 parent e1bca4c commit 830113a

14 files changed

Lines changed: 191 additions & 295 deletions

File tree

content/examples/3D and OpenGL/OpenGL/Esfera/Esfera.pde

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ float radio = 200;
1616
float rx = 0;
1717
float ry =0;
1818

19-
void setup(){
20-
size(800, 600, OPENGL);
21-
radio = height/4;
19+
void setup()
20+
{
21+
size(640, 480, OPENGL);
22+
radio = height/3.5;
2223

2324
lista = new pelo[cuantos];
2425
for (int i=0; i<cuantos; i++){
@@ -28,7 +29,8 @@ void setup(){
2829

2930
}
3031

31-
void draw(){
32+
void draw()
33+
{
3234
background(0);
3335
translate(width/2,height/2);
3436

@@ -49,10 +51,11 @@ void draw(){
4951
}
5052

5153

52-
class pelo{
54+
class pelo
55+
{
5356
float z = random(-radio,radio);
5457
float phi = random(TWO_PI);
55-
float largo=random(1.15,1.2);
58+
float largo = random(1.15,1.2);
5659
float theta = asin(z/radio);
5760

5861
void dibujar(){

content/examples/3D and OpenGL/OpenGL/Extrusion/Extrusion.pde

Lines changed: 0 additions & 55 deletions
This file was deleted.
-55.7 KB
Binary file not shown.

content/examples/3D and OpenGL/OpenGL/ExtrusionGL/ExtrusionGL.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ float angle;
1717

1818
void setup()
1919
{
20-
size(800, 600, OPENGL);
20+
size(640, 480, OPENGL);
2121

2222
aPixels = new int[width][height];
2323
values = new int[width][height];
@@ -48,7 +48,7 @@ void draw()
4848
// Display the image mass
4949
for (int i=0; i<a.height; i+=2) {
5050
for (int j=0; j<a.width; j+=2) {
51-
stroke(values[j][i]);
51+
stroke(values[j][i], 153);
5252
line(j-a.width/2, i-a.height/2, -values[j][i], j-a.width/2, i-a.height/2, -values[j][i]-10);
5353
}
5454
}

content/examples/3D and OpenGL/OpenGL/Geometry/Geometry.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ int style[];
2222

2323

2424
void setup() {
25-
size(800, 600, OPENGL);
25+
size(640, 480, OPENGL);
2626
frameRate(24);
2727
background(255);
2828

@@ -75,7 +75,7 @@ void draw() {
7575
background(0);
7676

7777
int index=0;
78-
translate(width/2,height/2,0);
78+
translate(width/2, height/2, 0);
7979
rotateX(PI/6);
8080
rotateY(PI/6);
8181

content/examples/3D and OpenGL/OpenGL/Lights/Lights.pde

Lines changed: 0 additions & 47 deletions
This file was deleted.

content/examples/3D and OpenGL/OpenGL/Matrix/Matrix.pde

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
* by Mixel.
44
*
55
* Simple example utilizing the OpenGL Library for Processing.
6-
*
7-
* Created 15 April 2005
86
*/
97

108
import processing.opengl.*;
119

1210
void setup()
1311
{
14-
size(800, 600, OPENGL);
12+
size(640, 480, OPENGL);
1513
noStroke();
1614
fill(0, 102, 153, 40);
1715
}

content/examples/3D and OpenGL/OpenGL/Yellowtail/Yellowtail.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* Yellowtail.
3-
* By Golan Levin.
2+
* Yellowtail
3+
* by Golan Levin.
44
*
55
* Click, drag, and release to create a kinetic gesture.
66
*/
@@ -22,7 +22,7 @@ int tmpYp[];
2222

2323
void setup()
2424
{
25-
size(800, 600, OPENGL);
25+
size(640, 480, OPENGL);
2626
myW = width;
2727
myH = height;
2828
background(0, 0, 0);
Lines changed: 48 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,48 @@
1-
/**
2-
* Sine.
3-
*
4-
* Smoothly scaling size with the sin() function.
5-
*
6-
* Updated 21 August 2002
7-
*/
8-
9-
float spin = 0.0;
10-
float radius = 42.0;
11-
float angle;
12-
13-
float angle_rot;
14-
int rad_points = 90;
15-
16-
void setup()
17-
{
18-
size(200, 200);
19-
noStroke();
20-
ellipseMode(CENTER_RADIUS);
21-
smooth();
22-
frameRate(30);
23-
}
24-
25-
void draw()
26-
{
27-
background(153);
28-
29-
translate(130, 65);
30-
31-
fill(255);
32-
ellipse(0, 0, 8, 8);
33-
34-
angle_rot = 0;
35-
fill(51);
36-
37-
for(int i=0; i<5; i++) {
38-
pushMatrix();
39-
rotate(angle_rot + -45);
40-
ellipse(-116, 0, radius, radius);
41-
popMatrix();
42-
angle_rot += PI*2/5;
43-
}
44-
45-
radius = 17 * sin(angle) + 84;
46-
47-
angle += 0.03;
48-
if (angle > TWO_PI) { angle = 0; }
49-
}
50-
1+
/**
2+
* Sine.
3+
*
4+
* Smoothly scaling size with the sin() function.
5+
*
6+
* Updated 21 August 2002
7+
*/
8+
9+
float spin = 0.0;
10+
float diameter = 84.0;
11+
float angle;
12+
13+
float angle_rot;
14+
int rad_points = 90;
15+
16+
void setup()
17+
{
18+
size(200, 200);
19+
noStroke();
20+
smooth();
21+
}
22+
23+
void draw()
24+
{
25+
background(153);
26+
27+
translate(130, 65);
28+
29+
fill(255);
30+
ellipse(0, 0, 16, 16);
31+
32+
angle_rot = 0;
33+
fill(51);
34+
35+
for(int i=0; i<5; i++) {
36+
pushMatrix();
37+
rotate(angle_rot + -45);
38+
ellipse(-116, 0, diameter, diameter);
39+
popMatrix();
40+
angle_rot += PI*2/5;
41+
}
42+
43+
diameter = 34 * sin(angle) + 168;
44+
45+
angle += 0.02;
46+
if (angle > TWO_PI) { angle = 0; }
47+
}
48+

0 commit comments

Comments
 (0)