Well,
i´m testing my first testing JOGL application. This application consists to move a simple poligon (GL_TRIANGLE) through my GLCanvas.
My quad translate with key events but the quad is passing over the width and height frame limits.
I´m using a 640x480 frame.
To translate my quad the X argument is increased.
What the value X must have to stop this increase and avoid the screenwidth limits trepassing???
A question before I can answer. Are you rendering using an orthographic projection (2D) or real 3D? If your using an ortho projection, simply check if X is less than 0, if it is, set it back to 0 (after you increment X in your render loop). If your rendering real 3D, I suggest you simply play around with the values (using the same method above, but using negative or positive values, and play around with it). Find the best value that looks good.
I´m using glu.gluPerspective() (real 3D). Using gluPerspective() i perceived that I would play around to find the best value to set as my world limit, like you said. Now, using gl.glOrtho() - not glu.glOrtho2D - a friend told me that I could make the X increasing based in each GLCanvas pixel but this advice did not make any sense. My intention was to find the values wich would be the limits but i thought could exist a better way. I´ll folow your last advice. thnx