Skip to content

Commit 938727d

Browse files
committed
Adding a new batch of examples
1 parent d3e05af commit 938727d

File tree

1,176 files changed

+47658
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,176 files changed

+47658
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Move Eye.
3+
* by Simon Greenwold.
4+
*
5+
* The camera lifts up (controlled by mouseY) while looking at the same point.
6+
*/
7+
8+
void setup() {
9+
size(400, 400, P3D);
10+
fill(204);
11+
}
12+
13+
void draw() {
14+
lights();
15+
background(0);
16+
// Change height of the camera with mouseY
17+
camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ
18+
0.0, 0.0, 0.0, // centerX, centerY, centerZ
19+
0.0, 1.0, 0.0); // upX, upY, upZ
20+
noStroke();
21+
box(90);
22+
stroke(255);
23+
line(-100, 0, 0, 100, 0, 0);
24+
line(0, -100, 0, 0, 100, 0);
25+
line(0, 0, -100, 0, 0, 100);
26+
}
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import processing.core.*; import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*; public class MoveEye extends PApplet {/**
2+
* Move Eye.
3+
* by Simon Greenwold.
4+
*
5+
* The camera lifts up (controlled by mouseY) while looking at the same point.
6+
*/
7+
8+
public void setup() {
9+
size(400, 400, P3D);
10+
fill(204);
11+
}
12+
13+
public void draw() {
14+
lights();
15+
background(0);
16+
// Change height of the camera with mouseY
17+
camera(30.0f, mouseY, 220.0f, // eyeX, eyeY, eyeZ
18+
0.0f, 0.0f, 0.0f, // centerX, centerY, centerZ
19+
0.0f, 1.0f, 0.0f); // upX, upY, upZ
20+
noStroke();
21+
box(90);
22+
stroke(255);
23+
line(-100, 0, 0, 100, 0, 0);
24+
line(0, -100, 0, 0, 100, 0);
25+
line(0, 0, -100, 0, 0, 100);
26+
}
27+
static public void main(String args[]) { PApplet.main(new String[] { "MoveEye" });}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Move Eye.
3+
* by Simon Greenwold.
4+
*
5+
* The camera lifts up (controlled by mouseY) while looking at the same point.
6+
*/
7+
8+
void setup() {
9+
size(400, 400, P3D);
10+
fill(204);
11+
}
12+
13+
void draw() {
14+
lights();
15+
background(0);
16+
// Change height of the camera with mouseY
17+
camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ
18+
0.0, 0.0, 0.0, // centerX, centerY, centerZ
19+
0.0, 1.0, 0.0); // upX, upY, upZ
20+
noStroke();
21+
box(90);
22+
stroke(255);
23+
line(-100, 0, 0, 100, 0, 0);
24+
line(0, -100, 0, 0, 100, 0);
25+
line(0, 0, -100, 0, 0, 100);
26+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
4+
<html>
5+
<head>
6+
<title>MoveEye : Built with Processing</title>
7+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
8+
<style type="text/css">
9+
<!--
10+
11+
body {
12+
margin: 0px 0px 0px 0px;
13+
font-family: verdana, geneva, arial, helvetica, sans-serif;
14+
font-size: 11px;
15+
background-color: #DDDDCC;
16+
text-decoration: none;
17+
font-weight: normal;
18+
line-height: normal;
19+
}
20+
21+
A { color: #3399CC; }
22+
A:link { color: #3399CC; text-decoration: underline; }
23+
A:visited { color: #3399CC; text-decoration: underline; }
24+
A:active { color: #3399CC; text-decoration: underline; }
25+
A:hover { color: #3399CC; text-decoration: underline; }
26+
27+
#content {
28+
position: absolute;
29+
left: 55px;
30+
top: 60px;
31+
}
32+
33+
-->
34+
</style>
35+
36+
</head>
37+
38+
<body>
39+
40+
<div id="content">
41+
42+
<div>
43+
<applet code="MoveEye" archive="MoveEye.jar"
44+
width="400" height="400" mayscript="true">
45+
<param name="image" value="loading.gif">
46+
<param name="boxmessage" value="Loading Processing software...">
47+
<param name="boxbgcolor" value="#FFFFFF">
48+
49+
<!-- This is the message that shows up when people don't have
50+
Java installed in their browser. Any HTML can go here
51+
(i.e. if you wanted to include an image other links,
52+
or an anti-Microsoft diatribe. -->
53+
To view this content, you need to install Java from <A HREF="http://java.com">java.com</A>
54+
55+
</applet>
56+
</div>
57+
58+
<p>
59+
Move Eye.
60+
by Simon Greenwold.
61+
62+
The camera lifts up (controlled by mouseY) while looking at the same point.
63+
64+
</p>
65+
66+
<p>
67+
Source code: <a href="MoveEye.pde">MoveEye</a>
68+
</p>
69+
70+
<p>
71+
Built with <a href="http://processing.org" title="Processing.org">Processing</a>
72+
</p>
73+
74+
</div>
75+
76+
</body>
77+
</html>
2.18 KB
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Ortho.
3+
*
4+
* Move the mouse across the screen to change the parameters
5+
* for the orthographic projection.
6+
* The ortho() function sets an orthographic projection and
7+
* defines a parallel clipping volume. All objects with the
8+
* same dimension appear the same size, regardless of whether
9+
* they are near or far from the camera. The parameters to this
10+
* function specify the clipping volume where left and right
11+
* are the minimum and maximum x values, top and bottom are the
12+
* minimum and maximum y values, and near and far are the minimum
13+
* and maximum z values.
14+
*
15+
* Created 28 April 2005
16+
*/
17+
18+
void setup()
19+
{
20+
size(200, 200, P3D);
21+
noStroke();
22+
}
23+
24+
void draw()
25+
{
26+
background(255);
27+
lights();
28+
29+
//ortho(0, width, 0, height, -10, 10); // Default ortho settings
30+
ortho(-width, mouseX, -height/2.0, mouseY/2.0, -10, 10);
31+
32+
translate(0, 0, -100);
33+
rotateX(PI/4);
34+
rotateZ(PI/3);
35+
36+
pushMatrix();
37+
for(int i=0; i<width; i+=20) {
38+
for(int j=0; j<height; j+=20) {
39+
box(10, 10, (j+i) / 4.0);
40+
translate(20, 0, 0);
41+
}
42+
translate(-200, 20, 0);
43+
}
44+
popMatrix();
45+
46+
}
47+
152 KB
Binary file not shown.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import processing.core.*; import java.applet.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; import java.io.*; import java.net.*; import java.text.*; import java.util.*; import java.util.zip.*; public class Ortho extends PApplet {/**
2+
* Ortho.
3+
*
4+
* Move the mouse across the screen to change the parameters
5+
* for the orthographic projection.
6+
* The ortho() function sets an orthographic projection and
7+
* defines a parallel clipping volume. All objects with the
8+
* same dimension appear the same size, regardless of whether
9+
* they are near or far from the camera. The parameters to this
10+
* function specify the clipping volume where left and right
11+
* are the minimum and maximum x values, top and bottom are the
12+
* minimum and maximum y values, and near and far are the minimum
13+
* and maximum z values.
14+
*
15+
* Created 28 April 2005
16+
*/
17+
18+
public void setup()
19+
{
20+
size(200, 200, P3D);
21+
noStroke();
22+
}
23+
24+
public void draw()
25+
{
26+
background(255);
27+
lights();
28+
29+
//ortho(0, width, 0, height, -10, 10); // Default ortho settings
30+
ortho(-width, mouseX, -height/2.0f, mouseY/2.0f, -10, 10);
31+
32+
translate(0, 0, -100);
33+
rotateX(PI/4);
34+
rotateZ(PI/3);
35+
36+
pushMatrix();
37+
for(int i=0; i<width; i+=20) {
38+
for(int j=0; j<height; j+=20) {
39+
box(10, 10, (j+i) / 4.0f);
40+
translate(20, 0, 0);
41+
}
42+
translate(-200, 20, 0);
43+
}
44+
popMatrix();
45+
46+
}
47+
48+
static public void main(String args[]) { PApplet.main(new String[] { "Ortho" });}}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/**
2+
* Ortho.
3+
*
4+
* Move the mouse across the screen to change the parameters
5+
* for the orthographic projection.
6+
* The ortho() function sets an orthographic projection and
7+
* defines a parallel clipping volume. All objects with the
8+
* same dimension appear the same size, regardless of whether
9+
* they are near or far from the camera. The parameters to this
10+
* function specify the clipping volume where left and right
11+
* are the minimum and maximum x values, top and bottom are the
12+
* minimum and maximum y values, and near and far are the minimum
13+
* and maximum z values.
14+
*
15+
* Created 28 April 2005
16+
*/
17+
18+
void setup()
19+
{
20+
size(200, 200, P3D);
21+
noStroke();
22+
}
23+
24+
void draw()
25+
{
26+
background(255);
27+
lights();
28+
29+
//ortho(0, width, 0, height, -10, 10); // Default ortho settings
30+
ortho(-width, mouseX, -height/2.0, mouseY/2.0, -10, 10);
31+
32+
translate(0, 0, -100);
33+
rotateX(PI/4);
34+
rotateZ(PI/3);
35+
36+
pushMatrix();
37+
for(int i=0; i<width; i+=20) {
38+
for(int j=0; j<height; j+=20) {
39+
box(10, 10, (j+i) / 4.0);
40+
translate(20, 0, 0);
41+
}
42+
translate(-200, 20, 0);
43+
}
44+
popMatrix();
45+
46+
}
47+

0 commit comments

Comments
 (0)