Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Dimension problem in Java

  1. #1
    Intern Contributor
    Join Date
    Apr 2002

    Dimension problem in Java


    I inserted an GLAnimCanvas in an JPanel which size is 931*652. In the GLAnimCanvas I draw a simple quad which size is 0.05*6.01 but it seems the quad is to big because it goes out of the JPanel I just see the top. I don't know how to configure these problems of size...
    I defined the gl.glViewport method with the size of the JPanel.. as I saw in all examples

    Could somebody help me?

    Thank you in advance

  2. #2
    Junior Member Newbie
    Join Date
    Apr 2002

    Re: Dimension problem in Java

    Hi Mat,
    This could be several things:
    i) If your viewport is set up incorrectly gl will only render to part of your window. Make sure you call glViewport(0, 0, window_width, window_height).
    ii) Your projection (gluPerspective/glFrustum/glOrtho) may be set up wrong. I think that the default is an orthographic projection (left: -1, right: 1, top: 1, bottom: -1).
    iii) You may be translating (glTranslate) the object such that only half of it is visible.

    I can't tell exactly what it is from your description, but check each of these and you should find the problem.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts