mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Examples mods for 2.0
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user