glBomb
02-13-2007, 04:59 AM
http://img184.imageshack.us/img184/9649/upld2cm4.png (http://imageshack.us)
Hi people
I tried to draw a simple quad from (-3,-4) to (0,0) using the commands below:
glBegin();
glVertex2i(-3,-4);//Top left
glVertex2i(0,-4);//Top right
glVertex2i(0,0);//Bottom right
glVertex2i(-3,0);//Bottom left
glEnd();
and i got the output in the left picture.The blue pixel is the origin.The yellow pixels are the pixels where i expected the quad boundary to be.And the red pixels are the actual output.What i cant get is if i want the upper left corner of the quad at(-3,-4) why is it ending up at (-3,-3)?
Also the bottom is not at the origin.there is a problem with the y-direction here
Then i tried positive numbers as:
glBegin();
glVertex2i(0,0);//Top left
glVertex2i(0,3);//Top right
glVertex2i(3,4);//Bottom right
glVertex2i(0,4);//Bottom left
glEnd();
Now i get the output at the right.Now there is a problem with the x-direction !!
Is there some convention regarding the drawing of quads in opengl ? That the boundary pixels will not be drawn?
Thanks...
Hi people
I tried to draw a simple quad from (-3,-4) to (0,0) using the commands below:
glBegin();
glVertex2i(-3,-4);//Top left
glVertex2i(0,-4);//Top right
glVertex2i(0,0);//Bottom right
glVertex2i(-3,0);//Bottom left
glEnd();
and i got the output in the left picture.The blue pixel is the origin.The yellow pixels are the pixels where i expected the quad boundary to be.And the red pixels are the actual output.What i cant get is if i want the upper left corner of the quad at(-3,-4) why is it ending up at (-3,-3)?
Also the bottom is not at the origin.there is a problem with the y-direction here
Then i tried positive numbers as:
glBegin();
glVertex2i(0,0);//Top left
glVertex2i(0,3);//Top right
glVertex2i(3,4);//Bottom right
glVertex2i(0,4);//Bottom left
glEnd();
Now i get the output at the right.Now there is a problem with the x-direction !!
Is there some convention regarding the drawing of quads in opengl ? That the boundary pixels will not be drawn?
Thanks...