• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

OTOT*****Simple OpenGL question, User Input and pixel size.*****

adlep

Diamond Member
HeSorry to posting here, but the Software section is rather slow today...:
have to create a line drawing algorithm (done), but on the top of that I need to add to my program an user's input option.
User should be able to specify the pixel size from 1 to 10 so that it is possible to see clearly the effect of rasterization in window.
So if user specifies 1, program draws a nice straight line, but if the input is 10, program draws a nasty, big line full of jigglies, because of no antialiasing algorithm...
Help Plz?
Is the SetPixel() function is a right function to use?
 
Pardon my ignorance, but the first look at the code doesn't shine any light 😱
Where is the user's input part?
Edit: Second look does reaveal some similarites, yet I have a feelingthat it is not qite what I am looking for 😀
Could you reaveal your google query ?
P.S. Congratualtions on your google skills....
 
From the code that was in that link (google query = OpenGL Point size):

glPointSize(2.0);

You can handle user input any way you want... through GLUI, the console... that's more programmer preference than anything else.
 
So I guess the SetPixel() function does specify the initial coodinates of the point and not the pixel size... Right?
 
That is correct.

I just realized something... glSetPixel() may not be affected by glPointSize(). Perhaps you need to draw your
lines like:

glBegin(GL_POINTS);
glVertex3f(x, y, z);
....
glEnd();

glSetPixel() operates purely on the pixel level.
 
Back
Top