jacksmash
04-30-2010, 07:15 AM
This is somewhat of a two part question. I'm drawing a simple matrix of rectangles that I want to be able to rotate about the x-axis, but such that it gives a 3D perspective.
So, I set up a frustum that has the near clipping pane at 1.0, and the far pane at 10.0. I'm really not sure what the best choices are for those values, but I'm drawing the matrix itself at z = -0.5
http://www.joelglanfield.com/images/1.jpg
The next image shows it rotated about the x-axis.
http://www.joelglanfield.com/images/2.jpg
Here's the catch: I want to highlight cells of the matrix when the mouse passes over them. If I draw the matrix at the origin, then this is quite trivial. But now since I'm drawing it at z = -0.5, plus I'm also rotating it, I'm not sure the best way to compare the mouse location so as to highlight the appropriate cell.
Any suggestions?
So, I set up a frustum that has the near clipping pane at 1.0, and the far pane at 10.0. I'm really not sure what the best choices are for those values, but I'm drawing the matrix itself at z = -0.5
http://www.joelglanfield.com/images/1.jpg
The next image shows it rotated about the x-axis.
http://www.joelglanfield.com/images/2.jpg
Here's the catch: I want to highlight cells of the matrix when the mouse passes over them. If I draw the matrix at the origin, then this is quite trivial. But now since I'm drawing it at z = -0.5, plus I'm also rotating it, I'm not sure the best way to compare the mouse location so as to highlight the appropriate cell.
Any suggestions?