glBegin(GL_LINES); glColor3F(255,0,0); glVertex(20,20,0); glColor3F(0,255,0); glVertex(50,50,0); glEnd();
glEnable(GL_LINE_SMOOTH); // all lines are drawn after this are drawn with antialiasing glDisable(GL_LINE_SMOOTH); // all lines are drawn after this are drawn without antialiasing
<line x1="0" y1="0" x2 = "100" y2="100" style="stroke: black; stroke-dasharray:9, 3, 5; stroke-width: 2;"/> <path d="M 300 300, 299.732 299.951, ... 700.268, 700 700" style="fill:cyan;stroke:black;"/>
the actual size is determined by rounding the supplied size to the nearest integer. (If the rounding results in the value 0, it is as if the point size were 1.) If the rounded size is odd, then the center point (x, y) of the pixel fragment that represents the point is computed as xw + .5 yw + .5 where w subscripts indicate window coordinates. All pixels that lie within the square grid of the rounded size centered at (x, y) make up the fragment. If the size is even, the center point is xw + .5 yw + .5 and the rasterized fragment's centers are the half-integer window coordinates within the square of the rounded size centered at (x, y). All pixel fragments produced in rasterizing a nonantialiased point are assigned the same associated data, that of the vertex corresponding to the point.
for (x = xPixel1 +1; x < xPixel2; x++) { this.SetPoint(ipart(y), x,r1,g1,b1,rfpart(y)); this.SetPoint(ipart(y)+1, x,r1,g1,b1,fpart(y)); y = y + gradient; }