Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: GClements

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Projecting a sphere to a point results in a...

    Projecting a sphere to a point results in a circular cone, whose axis is the line through the projection origin and the centre of the sphere. If the axis is perpendicular to the projection plane, the...
  2. Focal length has nothing to do with it. The...

    Focal length has nothing to do with it.

    The "correct" field of view angle is dictated by the size of the monitor and the distance of the eye from the monitor. The angle should be that subtended by...
  3. I couldn't find a decent tutorial, but it should...

    I couldn't find a decent tutorial, but it should be covered in any decent book (e.g. Stevens' "Advanced Programming in the Unix(R) Environment"; in spite of its name, it doesn't assume any prior...
  4. That's purely a design decision. Holding e.g....

    That's purely a design decision. Holding e.g. left+up may result in the two being combined (although you may wish to normalise the resulting vector, so that diagonal movement isn't faster than...
  5. Replies
    2
    Views
    148

    What are the units for mgRotation? glRotate()...

    What are the units for mgRotation? glRotate() treats the angle as being in degrees, but the standard C sin/cos functions (and those in any language I've used) treat the angle as being in radians.
  6. You may not find them mentioned in Xlib books;...

    You may not find them mentioned in Xlib books; they're core Unix functions.

    Both functions have the same purpose: given a set of file descriptors, wait either until at least one of the descriptors...
  7. Replies
    2
    Views
    117

    I suggest that you don't use any OpenGL matrix...

    I suggest that you don't use any OpenGL matrix functions other than glLoadMatrix() or possibly glMultMatrix(). If you need to access (or even just store) the matrices in the application, it's easier...
  8. Instead of rotating by a fixed amount for each...

    Instead of rotating by a fixed amount for each KeyPress event (which, when you hold a key down, means for each autorepeat), rotate by a fixed amount for a fixed time interval whenever the key is...
  9. Replies
    5
    Views
    218

    The simple way is to split the model into...

    The simple way is to split the model into multiple parts such that each part has a single texture, and render each part separately.

    The efficient way is to use either a texture atlas (multiple...
  10. No, it returns -1 if the attribute doesn't exist....

    No, it returns -1 if the attribute doesn't exist. It generates an error if the program is invalid or the function is called between glBegin() and glEnd().


    For each attribute, the VAO stores the...
  11. Calling an OpenGL function simply inserts the...

    Calling an OpenGL function simply inserts the command into the execution pipeline; it doesn't wait for it to be executed. glutSwapBuffers() performs an implicit glFinish(), which forces any pending...
  12. Because there's no point. The entire...

    Because there's no point. The entire fixed-function pipeline is deprecated. If you add a new function which only affects the fixed-function pipeline, old code won't use it because it didn't exist...
  13. Use an array of structs: struct light { ...

    Use an array of structs:


    struct light {
    ...
    } lights[NUM_LIGHTS];


    That isn't valid C. You need to provide an initialiser for the entire structure. Or for an array of structures, for...
  14. If you're using GLUT, the main loop (and the...

    If you're using GLUT, the main loop (and the switch statement inside it) are provided for you, by glutMainLoop().

    This calls the callbacks registered with glutDisplayFunc(), glutIdleFunc(), etc...
  15. The attribute arrays must be large enough to hold...

    The attribute arrays must be large enough to hold the data, but they can also be larger. The number of primitives drawn is determined by the "count" parameter to the draw call (glDrawArrays etc), not...
  16. Replies
    3
    Views
    382

    A cube has 8 vertices (in the mathematical sense;...

    A cube has 8 vertices (in the mathematical sense; see Alfonse' reply for the situation regarding OpenGL) and 6 faces.



    Yes.

    First, if flat-shading is enabled with glShadeModel(GL_FLAT) (for...
  17. There's nothing fundamentally wrong with...

    There's nothing fundamentally wrong with Ball:draw(), although whether it's actually correct depends upon the interpretation of the variables.

    One thing which is clearly wrong is that...
  18. The variable names are misleading, but there's...

    The variable names are misleading, but there's nothing actually wrong with it, assuming that uvs are normalised texture coordinates and c is the value from a depth texture (with range 0..1).

    If...
  19. Not quite. You're confusing memory layout...

    Not quite.

    You're confusing memory layout (row-major versus column-major) with transposition. While they may have the same effect in practice, they aren't actually the same thing. In particular,...
  20. Replies
    9
    Views
    1,266

    Well, it would effectively mandate floating-point...

    Well, it would effectively mandate floating-point depth buffers (the whole scheme falls apart with fixed-point). Or logarithmic depth (which is basically floating point without the mantissa).
    ...
  21. Are you trying to compile the shaders in a...

    Are you trying to compile the shaders in a different thread? If so, does that thread have a context bound to it? Does the context share data with the context used by the rendering thread?
  22. Yes. Although ideally you'd want to avoid...

    Yes. Although ideally you'd want to avoid performing the transformation for each vertex. Also, if you change the model-view matrix for each object, the light will move accordingly (i.e. the light...
  23. OpenGL doesn't have world coordinates. It has...

    OpenGL doesn't have world coordinates. It has object coordinates (the values passed via glVertexPointer etc), which are transformed by the model-view matrix to produce eye coordinates, which are...
  24. Any values you specify as uniforms or attributes...

    Any values you specify as uniforms or attributes are passed directly to the shaders without any transformation. The matrices (modelview, projection) are whatever you set them to.

    For...
  25. Replies
    26
    Views
    944

    There's all kinds of things you could do, far too...

    There's all kinds of things you could do, far too many to list really.

    The simplest is to apply some slightly non-linear transformation to either the input (i,j) or the output (r,alpha)....
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4