Hi, I have created these 3 rectangles one by one and I wish to achieve something like this:
but it turns out like this:
so the three objects, even though they actually are intersecting each other, don’t look like they are intersecting when I rotate them into other angles. They are just not following the normal rule for seeing.
Here is my code:
void ofApp::draw(){
gui.draw();
cam.begin();
ofPushMatrix();
rectangle2.draw();//Red
ofPopMatrix();
ofPushMatrix();
rectangle1.draw();//Blue
ofPopMatrix();
ofPushMatrix();
rectangle3.draw();//Green
ofPopMatrix();
cam.end();
}
and for most the code in each rectangle, they mostly look like this:
void Rect3::draw(){
ofSetColor(0,255,0);
ofFill();
ofRotateYDeg(90);
ofDrawRectangle(-100, -161.8, 0, w3, h3);
}
Could you please help me with this?