picking

hello.
I have a qt gui interface with an opengl widget.
I can draw disks(2d circular mesh) and lines, my problem is the picking.
1)how i can create a ray with a direction from the mouse for the picking?
2)How i can test the intersection of a ray with a disks and with a lines?
3)how i can transform the ray from the 2d view to model view?(is sufficent multiply for the inverse(in my case the transposed ) of the modelview matrix?

How have you implemented the drawing of lines? Do you have a geometry/vector math class to generate lines created from two points with an x,y coordinate. That's where you want start.

So your project will have a several line objects stored in a container such as std::vector. Each line is made up of two points. Iterate thru the container to determine if a selection is made using an intersection algorithm between the two points of each line and a selection point with some x,y distance. Use gluUnProject to convert the mouse selection point from local coordinates to project coordinates.

very thanks Praetorian.
Is properly as you described.
But my goal is to create a 2d camera for zooming and translating.
For this in another post i asked if glortho returns a matrix.
How i can get a matrix from an eye point that i can translate or go ahead(zoom in) or go far(zoom out)
I wish use only opengl function, not glut or other.
and I wish using matrixes,shader and vbo , is a project "like" acrobat reader , i use it for text drawing and other (lines and points)in opengl.

Use gluUnProject to convert the mouse selection point from local coordinates to project coordinates

isn't the same to multiply the points for the inverse of the modelview matrix (in this case the transpose of modelviewmatrix )
Thanks.

very thanks Praetorian.
Is properly as you described.
But my goal is to create a 2d camera for zooming and translating.
For this in another post i asked if glortho returns a matrix.
How i can get a matrix from an eye point that i can translate or go ahead(zoom in) or go far(zoom out)
I wish use only opengl function, not glut or other.
and I wish using matrixes,shader and vbo , is a project "like" acrobat reader , i use it for text drawing and other (lines and points)in opengl.

isn't the same to multiply the points for the inverse of the modelview matrix (in this case the transpose of modelviewmatrix )
Thanks.

It sounds like you're trying to do too many things at once. First focus on zooming.
I don't see any problem using glOrtho to implement zooming/panning for 2d as it works fine for me.

gluUnProject(point->x, point->y, point->z, modelMatrix, projMatrix, viewport, &objx, &objy, &objz);
is not the same as MVP->transpose() * point?
in this case i can use the transpose, because is a square matrix, else i must use the inverse.
is correct?
thanks.