PDA

View Full Version : Drawing onto an image



03-08-2002, 10:44 AM
Hi All,
I am new to OpenGL and I am now examining the option of using it to create a control for my project, however, I don’t know if OpenGL is the right tool to use.
What I need to do is very simple: Display a 3D image, then draw some visual effects on top of that image depending on user input.
Just to make it more visual, lets say that the image I will display is a plate and I would like to programmatically draw different types of food on it. Is it possible ?
And, would I be able to map the image so I’ll know if the user clicked on anything on the plate ? (probably that could be achieved by a kind of “Hit Test” on the coordinates of the click … just a guess).

Thanks in advance.

nexusone
03-08-2002, 11:19 AM
OpenGL can do all that you are looking for, though I think you have pose your subject wrong; it should have been how can I place an image on a 3D object.
Though OpenGL is mainly used for the control of 3D objects vs. 2D, though you can do 2D graphics with OpenGL.
One of the things is called texture mapping, which is nothing more then placing an image on a 3D object. Nehe has good examples of this at http://nehe.gamedev.net.
You will find information on using the mouse to control and picking 3D objects.

One example is that you can place an image on a cube or plate that rotates to show another image when the user clicks on it.



Originally posted by gild:
Hi All,
I am new to OpenGL and I am now examining the option of using it to create a control for my project, however, I don’t know if OpenGL is the right tool to use.
What I need to do is very simple: Display a 3D image, then draw some visual effects on top of that image depending on user input.
Just to make it more visual, lets say that the image I will display is a plate and I would like to programmatically draw different types of food on it. Is it possible ?
And, would I be able to map the image so I’ll know if the user clicked on anything on the plate ? (probably that could be achieved by a kind of “Hit Test” on the coordinates of the click … just a guess).

Thanks in advance.

[This message has been edited by nexusone (edited 03-08-2002).]

[This message has been edited by nexusone (edited 03-08-2002).]