08-13-2003, 09:39 AM

What is the best way to plot a pixel in a three dimensional graph based on the mouse position on the screen? When the user presses the mouse button the pixel should appear

where the mouse cursor is (which can be an infinite number of points going away from

the cursor position). I am guessing I should start by calculating a vector that

represents all posible values where the point could be plotted. Then I would need to

decide how far from the viewer to plot the point. I just have no idea how to go about

this mathematically.

This is for a simple project I am working on as part of my opengl education. I decided

to create a program that I can use to generate vertex arrays of scenes more quickly than coding glVertex3f() a million times and figuring out all the vertices by hand.

where the mouse cursor is (which can be an infinite number of points going away from

the cursor position). I am guessing I should start by calculating a vector that

represents all posible values where the point could be plotted. Then I would need to

decide how far from the viewer to plot the point. I just have no idea how to go about

this mathematically.

This is for a simple project I am working on as part of my opengl education. I decided

to create a program that I can use to generate vertex arrays of scenes more quickly than coding glVertex3f() a million times and figuring out all the vertices by hand.