I have a problem whit my little Opengl/freeglut/c++ 2D editor project.
the editor allows you to draw a quad or a triangle(Object). You can resize the object by draging a corner of the object where ever you want. you can also move the object around the screen if the object is active (you click on a object to make it active).
Now the problem that I'm having is to do whit the area that you click on to make the object active. The activation area used to be just a quad around the object (get the width and height of the object and so on) (Blue dots on the Picture show the activation area borders)
http://i48.tinypic.com/muyh41.png
But I want the activation area to be the area of the object not a quad around it. So the question is how would you check if the mouse was clicked inside area like in picture above or below this text?
OpenGL is just a drawing API and (Free)GLUT just a minimalistic framework for creating a window with an OpenGL context attached. Neither of them will help you there.
You must manually perform a ray triangle intersection test
These links may be of interest for you
http://www.lighthouse3d.com/tutorials/maths/ray-triangle-intersection/
http://www.gamedev.net/topic/447861-ray--triangle-intersection-code/