Hi, I’m probably the newest openGL programer!
I have a working application in which the user can control a cursor shaped as ‘L’, so it will perfectly match a target shaped as ‘L’ as well.
the application is 3D, so the match should be sensitive to orientation of ‘L’ cursor and target in space.
as I mentioned the application is already programmed (by someone else).
my job is to implement an automatic procedure that performs the process described above - something like a demo.
I know how to get the absolute location of the three vertices of the ‘L’ shape (both for cusrsor and target). my general plan is to calculate the distances between x/y/z axis of cursor and target, and then to give the cursor new coordinates closer and closer to the target until they perfectly match.
I’ll just mention that the way I retrieve the cursor and target absolute coordinates while drawing them is by using the code:
GLdouble Cursor_modelview; GLdouble Target_modelview; glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
and calculate the distances between cursor’s and target’s coresponding vertices (x/y/z) as follows:
x_Distance = Cur_modelview-Cur_modelview y_Distance = Cur_modelview-Cur_modelview z_Distance = Cur_modelview-Cur_modelview
Q1) how do I set the cursor’s new location (so it will get closer to the target)?
Q2) is there a function like glSETDoublev (so, I’ll be ablt to set in the array new values and it will be draw later accordingly).
THANKS FOR YOUR HELP. AS YOU CAN SEE I KNOW NOTHING IN OPENGL.