Example (C only, sorry) of how to convert the mouse position back into 3D coordinates. In Java you would use the same calls.

Sample exam questions

Assignments

Hints for C/Java

Working at home

Graphic programming nightmares

Example geometry drawings