PDA

View Full Version : Mouse Click Pointers



eggcroissant
05-09-2003, 07:30 PM
Hi,
Anyone can help me in this?
How do I get my program to display a marking, e.g. a red dot, when my mouse clicks on a certain polygon in my program?

Do I have to work with pixel drawing? Is there any other way?

Thanks.

yaro_dup1
05-10-2003, 01:46 AM
Do You mean 2D drawing or drawing on 3D polygons?

eggcroissant
05-10-2003, 02:19 AM
i have a cube with the 6 faces formed using flat 3D square polygons. I need to draw a point on the surface of the cube when the mouse clicks on it.

Thanks. http://www.opengl.org/discussion_boards/ubb/wink.gif

Mihail121
05-10-2003, 03:47 AM
The solution to your problem is not so simple i'm afraid.First you'll have to check if the click is on the cube and on which face.Then using to transform mouse position you find the click place in world coords.Using interpolation you must find the texcoord that's lying on that point and finally you must load a new texture over the old one(called decal) by using a small quad which center is the texcoord you've found.