Good day,
I have a couple of JOGL/OpenGL related questions.
Here is a screenshot of what I have so far.
http://www.radford.edu/~cbratton/test.PNG
It is basically a real time strategy interface. I have setup a 64x64 grid of tiles randomly colored and a third person camera hovering above the surface. Moving the mouse to the edges of the screen will pan the view appropriately. Then I have an overlay at the bottom as the user interface.
My questions are:
-
How do I not render something that is not currently visible? I know that with the Graphics class you could set a clip and even if you draw outside of that region the operation would not be performed. After making a 256x256 grid of tiles I could tell by the loss of FPS that I was rendering GL_QUADS offscreen.
-
How do I translate coordinates from my screen into points of intersection in the GLCanvas? In other words, in the attached file my mouse is at the point 847.0, 186.0. I want to know the coordinates of that quad.
I appreciate your time reading this. I have read many of the tutorials and comments on this site. My apologies if I skipped a lesson or if a solution/example has already been posted.
Thank you!