Odd Drawing Problem in P3D
in
Programming Questions
•
5 months ago
I have created an object called a "Block."
It has a function called update that draws it.
public void update(float xTrans, float yTrans, float zTrans, float rotateX, float rotateY, int[] rgb) {
translate(xTrans, yTrans, zTrans);
scale(30);;
rotateX(rotateX);
rotateY(rotateY);
fill(rgb[0], rgb[1], rgb[2]);
stroke(2);
box(1);
}
This works great when I call it once.
When a call it again, with different parameters for a different cube (let's say, 50px to the right of the first block and 50px up of the first block), only the first cube is drawn.
When I draw the second cube alone, without drawing the first, it is drawn no problem.
What might be causing this issue and what would a solution be?
1