Hey again people…
OK I want to write a small tic-tac-toe style game (also known as X/O game) but there is this one little problem I’m having and I can’t seem to figure out an efficient way to go about it.Here’s my problem:
OK you guys know what the X/O grid looks like,right? Well,it’s going to be rotating along it’s y and x axis (but not the z) and only at small angles.Now,when the user clicks inside the grid to place an X or an O,how do I detect where he’s trying to place it? If the grid was totally static,then I can just keep checking screen coordinates and tell where to position the X or the O.But when the grid is rotating (at small angles),how do I keep track of where the user is clicking?(This grid is never going to rotate more that 60 degrees on either axis)
The way I initially though of solving this problem is by having an invisible cube at each part of the grid and then using the OpenGL selection buffer to detect which one of these cubes the user has hit.Then replace the invisible cude with an X or an O depending on what the player is.Any ideas?