I developped a small games like “minecraft”. and I’m stuck for a few days on the calculation of the direction of the cursor.
Let me explain.
I would like to target a cube with my cursor in the middle of the screen and make it disappear with a click. But I do not see any how to recover this information ..
Can someone point me to a “sample / tutorial” or explanation please?
Thank you very much.
My screenShoot picture game :

I take no credit for most of this–it’s what I used in my 3D XNA game and it worked. The comments are fairly explanative. Basically it projects a
Raystraight from your cursor position and checks to see if itIntersects()the boundingsphere of any map objects (Units in this case)