Examples mods for 2.0

This commit is contained in:
Casey Reas
2011-09-16 05:00:28 +00:00
parent c3b8b312a0
commit 472fd13b2f
20 changed files with 210 additions and 241 deletions
@@ -1,10 +1,14 @@
/**
* Texture 1.
* Texture Quad.
*
* Load an image and draw it onto a quad. The texture() function sets
* the texture image. The vertex() function maps the image to the geometry.
*/
// @pjs preload must be used to preload media if the program is
// running with Processing.js
/* @pjs preload="berlin-1.jpg"; */
PImage img;
void setup() {
@@ -21,8 +25,8 @@ void draw() {
beginShape();
texture(img);
vertex(-100, -100, 0, 0, 0);
vertex(100, -100, 0, 400, 0);
vertex(100, 100, 0, 400, 400);
vertex(-100, 100, 0, 0, 400);
vertex(100, -100, 0, 300, 0);
vertex(100, 100, 0, 300, 300);
vertex(-100, 100, 0, 0, 300);
endShape();
}