# Search:

Type: Posts; User: GClements

Page 1 of 20 1

1. ## Thread: Draw a shpere, but look more like an egg, what's matter?

by GClements
Replies
22
Views
367

### 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. ## Thread: Draw a shpere, but look more like an egg, what's matter?

by GClements
Replies
22
Views
367

### 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. ## Thread: this questions about xlib not opengl but i figure some of you may know :)

by GClements
Replies
8
Views
275

### 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. ## Thread: this questions about xlib not opengl but i figure some of you may know :)

by GClements
Replies
8
Views
275

### 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. ## Thread: OpenGL Moving Character

by GClements
Replies
2
Views
154

### 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. ## Thread: this questions about xlib not opengl but i figure some of you may know :)

by GClements
Replies
8
Views
275

### 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. ## Thread: Object not rendering after rotation

by GClements
Replies
2
Views
121

### 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. ## Thread: this questions about xlib not opengl but i figure some of you may know :)

by GClements
Replies
8
Views
275

### 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. ## Thread: A few questions from a newbie

by GClements
Replies
5
Views
223

### 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...

by GClements
Replies
7
Views
200

### 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...

by GClements
Replies
7
Views
200

### 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. ## Thread: How to simplify these redundancy statements? say light.....

by GClements
Replies
20
Views
502

### 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. ## Thread: How to simplify these redundancy statements? say light.....

by GClements
Replies
20
Views
502

### 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. ## Thread: using GLUT and calling an infinite loop routine won't work ?

by GClements
Replies
2
Views
165

### 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. ## Thread: Performance Issue: Drawing many primitives (>1M)

by GClements
Replies
12
Views
577

### 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...

by GClements
Replies
3
Views
386

### 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.

17. ## Thread: Ball doesn't rotate right after applying angular acceleration

by GClements
Replies
3
Views
221

### 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. ## Thread: Get Pixel Position for lighting and ssao from depth ?

by GClements
Replies
5
Views
312

### 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. ## Thread: Transformation in Fixed coordinate system

by GClements
Replies
12
Views
576

### 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. ## Thread: True Camera via OpenGL4.5

by GClements
Replies
9
Views
1,273

### 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).
...

by GClements
Replies
2
Views
208

### 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. ## Thread: Issues with smooth edges spotlights in OpenGL

by GClements
Replies
45
Views
1,161

### 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. ## Thread: Issues with smooth edges spotlights in OpenGL

by GClements
Replies
45
Views
1,161

### 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. ## Thread: Issues with smooth edges spotlights in OpenGL

by GClements
Replies
45
Views
1,161

### 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. ## Thread: 3D Texture producing stripes

by GClements
Replies
26
Views
947

### 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