Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>GLU.gluLookAt(gl, 0, 0, -5f, 0f, 0f, 0f, 0.0f, 1.0f, 0.0f); </code></pre> <p>Try to change -5f to 0, what you're saying here is displace the camera 5 units back, therefore unless you're doing an orthogonal projection (which I think you're not, try checking out <a href="http://www.opengl.org/sdk/docs/man/xhtml/glOrtho.xml" rel="nofollow">this</a>) what OpenGL is doing is scaling your background polygon according to your perspective view, and you see it as 'smaller'.</p> <p>If you do an orthogonal projection, no matter how much you move your camera in the z axis, you will always see it the same size. This is useful for 2D OpenGL-based games, so do check out the link above.</p> <p>EDIT: gluPerspective and glOrtho</p> <pre><code>gluPerspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); </code></pre> <p>gluPerspective has a parameter called 'fovy', which is basically the 'Field of View in the Y axis'. The field of view expresses the amount of space the camera can see, basically 'expanding' or 'contracting' whatever vertices happen to be before it. A typical human eye has a 45º FOV.</p> <p>The zNear and zFar express the near and far frustum limits, the frustum being an invisible 'box' which determines which vertices are outside the viewing area.</p> <p>Aspect determines the ratio between the width and height of the camera.</p> <p>glOrtho is a special case of gluPerspective in the sense that the FOV is always 0.</p> <pre><code>gl.glOrthof(0.0f, (float) width, (float) height, 0.0f, 1.0f, -1.0f); </code></pre> <p>The first four parameters specify the size of the clipping plane (normally the size of the screen), the other two values specifiy the frustum near and far (which you don't need unless you want to hide objects by placing them 'far away'.</p> <p>I hope this cleared it up a bit for you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload