We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Having trouble getting correct texture loading.
PImage IMG;
PShape SHP;
int numDetail = 360;
float rot = TWO_PI/numDetail;
void setup() {
size(400, 400, P3D);
IMG = loadImage("earth.jpg");
smooth();
}
void draw() {
background(255);
translate(width/2, height/2);
float radCircle = 200;
beginShape();
texture(IMG);
for (int i=0; i<numDetail; i++) {
float angle = i*rot;
float x = cos(angle);
float y = sin(angle);
vertex(x*radCircle, y*radCircle, x*radCircle, y*radCircle);
}
endShape(CLOSE);
}