I am trying to make a chess game at this moment, using Irrlicht.
It will be a 3D Chess game but apart from most chess games it has one special quality: Free movement of the camera.
The Chess game is found in a closed room, the player can move into that room as in a MMORPG or such ( w,a,s,d move and hold right-click to rotate the camera ). It can move anywhere he wants but there will be collision detection between the player and the pieces/board/walls.
Now,I want to make the pieces move when the player click on them.Untill now I basically got the coords of a squeare ( the window ones ) And I checked the coords of the mouse click.But considering my moveable camera the coords of a squeare will never be the same, so how should I make the game realise which square I click?. My board is an obj object made in blender.
Question: How to get the mouse input in order to realise which squeare has been clicked?
Edit due to comment:
I have looked upon the tutorial for collision detection don't worry. The main ideea is that I am not sure how to "draw" a ray from my mouse to the square or the first thing it his, or how to determine if it hit a square or not the "wooden" thing around it.
This is how the game begins:
It happens that you can move around and click where u want to.So it can be from a diffrent angle such as this:
Or even from under the table:
The main ideea is that i want to know which square he hit, and if he hit a square an not the wooden thinggy + the mouse isn't always clicked from the middle of the screen such as in the tutorial, it can be clicked from anywhere.