Created
August 4, 2015 17:08
-
-
Save novadeviator/c8929899372ef5a9f90b to your computer and use it in GitHub Desktop.
processing sketch wobling the texture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// undecorate window (remove window borders etc) - - - - - - - - - - - - - - - | |
public void init() { frame.removeNotify(); frame.setUndecorated(true); | |
frame.addNotify(); super.init(); } | |
// declarations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
PImage texture1; | |
float oscilator; | |
void setup() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
float sizefactor = 1; // define the size of the screen | |
size( int( 1920 * sizefactor ), | |
int( 1080 * sizefactor ), | |
P3D ); // renderer | |
// framerate | |
frameRate(60); | |
texture1 = loadImage("colorado.jpg"); | |
} | |
void draw() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
oscilator = frameCount % 628; | |
oscilator = oscilator * 0.01; | |
oscilator = sin(oscilator); | |
oscilator = oscilator * 0.1; | |
oscilator = oscilator + 1; | |
background(0); | |
// fill(127, 127); | |
stroke(255,1); | |
beginShape(QUAD_STRIP); | |
textureMode(NORMAL); | |
texture(texture1); | |
vertex(0, 0, 0, 0); | |
vertex(0, height, 0, 1); | |
vertex(width*0.25, 0, 0.25, 0); | |
vertex(width*0.2, height, 0.2, 1); | |
vertex(width*0.66, 0, 0.56 * oscilator, 0); | |
vertex(width*0.80, height, 0.70 * oscilator, 1); | |
vertex(width, 0, 1, 0); | |
vertex(width, height, 1, 1); | |
endShape(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment