Hello i want to create layer system and i cant ENABLE_DEPTH_SORT in a hint…
Its resizing… yeah one of two objects gets before and after when i moving mouse, but i want to make it without sizing… can you help me ?
void setup() {
size(500, 500, P3D);
((PGraphicsOpenGL)g).textureSampling(3);
hint(ENABLE_DEPTH_SORT);
}
void draw() {
background(0);
pushMatrix();
translate(0, 0, 100);
fill(255, 0, 0);
rect(100, 100, 200, 300);
popMatrix();
pushMatrix();
translate(0, 0, mouseX);
fill(0, 255, 0);
rect(200, 100, 200, 300);
popMatrix();
}