could you explain me why my texture is monochromatic?
in
Programming Questions
•
11 months ago
hi ,
i want to make a program to simply create texture with points and vertex.
the program work with triangles shapes and i could make it with custom shape too but the problem is i dont understand why my texture is monochromatic?
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
PImage img;
int nombre;
int[] pos, posY;
int currentNombre=1;
void setup() {
size(500, 500, P3D);
img = loadImage("333.jpg");
img.resize(500, 370);
int nombre = 330;
pos= new int[nombre];
posY= new int[nombre];
}
void draw() {
noFill();
for (int i=0;i<currentNombre-1;i++) {
for (int j =0; j<currentNombre-1;j++) {
point(pos[i], posY[i]);
//line(pos[i],posY[i],pos[i+1],posY[i+1]);
beginShape();
texture(img);
vertex(pos[i], posY[i]);
vertex(pos[i+1], posY[i+1]);
vertex(pos[j], posY[j]);
vertex(pos[j+1], posY[j+1]);
if (keyPressed) {
endShape(CLOSE);
}
// line(pos[i+1],posY[i+1],pos[i+2],posY[i+2]);
}
}
if (mousePressed) {
pos[currentNombre]=mouseX;
posY[currentNombre]=mouseY;
currentNombre +=1;
mousePressed=false;
}
/* if(KeyPressed){
beginShape();
texture(img);/*/
}
1