Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage txtr;
- PVector off;
- PVector scl;
- void setup() {
- size(512, 256, P3D);
- textureMode(NORMAL);
- textureWrap(REPEAT);
- noStroke();
- txtr = loadImage("txtr.png");
- off = new PVector();
- float aspect = width / (float)height;
- scl = new PVector(3 * aspect, 3);
- }
- void draw() {
- background(0xffffffff);
- beginShape();
- texture(txtr);
- vertex(0, 0, 0, off.x, off.y);
- vertex(width, 0, 0, off.x + scl.x, off.y);
- vertex(width, height, 0, off.x + scl.x, off.y + scl.y);
- vertex(0, height, 0, off.x, off.y + scl.y);
- endShape(CLOSE);
- off.x += 0.01;
- off.y += 0.005;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement