about 3d point selection

Started by
0 comments, last by V-man 15 years, 4 months ago
Is there any simple way to select a point in 3d space? I want to select a point and then add a light source at runtime but a click on the window selects a ray. I know that changing the view and selecting from the ray a point would do the job but i don't know that this is user friendly and easy to implement. thanks in advance
Advertisement
Find the point that is closest to the mouse
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement