Skip to content

Instantly share code, notes, and snippets.

@OmerShapira
Created December 3, 2012 18:21
Show Gist options
  • Save OmerShapira/4196862 to your computer and use it in GitHub Desktop.
Save OmerShapira/4196862 to your computer and use it in GitHub Desktop.
OpenGL Texture Mapping
PImage img;
void setup(){
size(800,600,P3D);
img = loadImage("http://upload.wikimedia.org/wikipedia/commons/4/48/Dirk_Benedict_-_Lucca_Comics_%26_Games_2011.jpg");
}
void draw(){
background(0);
beginShape();
texture(img);
//vertex(x, y, u, v);
vertex(10,10,0,0);
vertex(400,10,500,0);
vertex(400,600,500,500);
vertex(10,200,0,500);
endShape();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment