Original Post
Hi all,
I have been using gluProject in my 3D scene with the following code:
The problem is that the label 'Marker' is being drawn twice, once where it is supposed to be at (3D Object) and then again when the user is facing away from the object, but in the right position. That is, when I face the real marker, then turn exactly 180 degrees around there is another fake marker.
I think this may have something to do with a Z coordinate from gluProject, but I tried only drawing the marker when label_position_z was less than 0 and then only when more than 0; no results, still two markers.
Any help is greatly appreciated,
mikey
I have been using gluProject in my 3D scene with the following code:
gluProject(x_position,
y_position, z_position, model_view_matrix, projection_matrix, viewport, &label_position_x, &label_position_y, &label_position_z);
print("Marker" ,label_position_x,label_position_y);
glGetDoublev(GL_MODELVIEW_MATRIX, model_view_matrix);
glGetDoublev(GL_PROJECTION_MATRIX, projection_matrix);
glGetIntegerv(GL_VIEWPORT, viewport);
The problem is that the label 'Marker' is being drawn twice, once where it is supposed to be at (3D Object) and then again when the user is facing away from the object, but in the right position. That is, when I face the real marker, then turn exactly 180 degrees around there is another fake marker.
I think this may have something to do with a Z coordinate from gluProject, but I tried only drawing the marker when label_position_z was less than 0 and then only when more than 0; no results, still two markers.
Any help is greatly appreciated,
mikey