Sphere Pattern
Hi everybody,
I have the following problem:
I want to move an openGL sphere around a sphere pattern based only on x/y mouse coordinates from the window.
For example: 512 pixels square window. From 0 to 256 for the mouse horizontal movement, the sphere should move from 0 to 512 on the x plane, and going forward on the z plane. For 256 to 512 with the mouse horizontal movement, the sphere should move from 512 to 0, BUT behind the center point on the z plane. The same thing goes on the y plane, with the sphere moving up and down and forward/behind on the z-plane.
It's just trigonometry but I can't figure it out.
Much thanks to anyone that will help me