Two options come to mind (if I understand your problem):
-
Do all the drawing in 2Dand use glRotate on the modelview matrix to place your plane and vector to the correct oreintationin 3D (and glTranslate to move the plane if it is supposed to be in a different place). Then you don’t need polar coordinates, but depending on what else you’re doing in the scene, that may not be as useful… but if you can make this work, the performance is probably best.
-
Calculate how the plane’s orientation was changed (without more information about how your geometry is stored, I’m not sure what the best way to do this would be for you), and rotate the vector. This could use glRotate also, or if you want to do the calculation on the processor side, you could use a Quaternion technique. The below code snippet will do this (it uses the vecmath package from Java3D).
//r is the Vector3f to rotate about, diff is the Vector3f to rotate, angle is the angle to rotate in degrees
Quat4f v = new Quat4f();
v.set(diff.x,diff.y,diff.z,0);
Quat4f z = new Quat4f();
z.set(new AxisAngle4f(r,(float)Math.toRadians(angle)));
//perform v = z*v*z^-1:
v.mulInverse(z);
v.mul(z,v);
//vVec is the rotated vector
Vector3f vVec = new Vector3f(v.x,v.y,v.z);