I would start with reimplementing mousePressEvent As for the hittest itself, take a look at NeHe lessons, as far as I remember it's described there how to project the cursor into 3D space.