Hi I’m working with the processing library for Java, and are having some issues giving my shapes a texture, right now, the texture isn’t showing. I hope some of you guys might have an idea, of what I’m doing wrong.
IDE is eclipse.
Heres my code:
public class View extends PApplet {
PImage img;
PShape myShape;
public void setup() {
img = loadImage("assets\\images\\test.jpg");
}
public void settings() {
size(displayHeight*3>>2, displayHeight*3>>2);
}
public void draw() {
background(175);
myShape = createShape();
textureMode(NORMAL);
myShape.beginShape();
myShape.texture(img);
myShape.vertex(0, 0, 0, 0);
myShape.vertex(100, 0, 1, 0);
myShape.vertex(100, 100, 1, 1);
myShape.vertex(0, 100, 0, 1);
myShape.endShape(CLOSE);
shape(myShape);
}
}
The image: