hallo together,
i am a bit new to opengl. i am working with opengl via the openframeworks toolkit. i have a question about drawing a line and then mirroring it and draw it again. my problem is that this line dont looks the same when i draw it mirrored. the best would be if you look to the atached pic below (it is a 500% zoomed screenshot of my 1 pixel line):
here are some code snippets which i tried:
void testApp::draw(){
ofPushMatrix();
ofTranslate(1024/2+60,768/2);
glBegin(GL_LINES);
glVertex2f(30,0);
glVertex2f(35.0,5.0);
glEnd();
glBegin(GL_LINES);
glVertex2f(35.0,5.0);
glVertex2f(35.0,19.0);
glEnd();
glBegin(GL_LINES);
glVertex2f(35.0,19.0);
glVertex2f(34.0,20.0);
glEnd();
glBegin(GL_LINES);
glVertex2f(20,0);
glVertex2f(15.0,5.0);
glEnd();
glBegin(GL_LINES);
glVertex2f(15.0,5.0);
glVertex2f(15.0,19.0);
glEnd();
glBegin(GL_LINES);
glVertex2f(15.0,19.0);
glVertex2f(16.0,20.0);
glEnd();
ofPopMatrix();
ofPushMatrix();
ofTranslate(1024/2+30,768/2);
glBegin(GL_LINE_STRIP);
glVertex2f(30,0);
glVertex2f(35.0,5.0);
glVertex2f(35.0,19.0);
glVertex2f(34.0,20.0);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex2f(20,0);
glVertex2f(15.0,5.0);
glVertex2f(15.0,19.0);
glVertex2f(16.0,20.0);
glEnd();
ofPopMatrix();
ofPushMatrix();
ofTranslate(1024/2,768/2);
for(int j=0;j<2;j++){
glBegin(GL_LINE_STRIP);
glVertex2f(0,0);
glVertex2f(5.0,5.0);
glVertex2f(5.0,19.0);
glVertex2f(4.0,20.0);
glEnd();
ofRotateZ(180);
ofRotateX(180);
ofTranslate(10,0);
}
ofPopMatrix();
ofPushMatrix();
ofTranslate(1024/2+30,768/2);
for(int j=0;j<2;j++){
glBegin(GL_LINE_STRIP);
glVertex2f(0,0);
glVertex2f(5.0,5.0);
glVertex2f(5.0,19.0);
glVertex2f(4.0,20.0);
glEnd();
glScalef(-1, 1, 1);
ofTranslate(10,0);
}
ofPopMatrix();
}
all the snippets failed.
so i think you see what my problem is.
my question now is: is it be posibble to draw the line that it exactly looks the same like the first one? or is this not possible cause of antialiasing and other issues?