PDA

View Full Version : gluLookAt, Blending



vivek vyas
05-24-2009, 10:54 PM
i am 16(17 at 13/07/(this year) beginner)

Q1. i have problem regarding gluLookAt function
it have 6 parameters
3 directional 3 positional 3 which are my confusion
gluLookAt(GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
what are these last
GLdouble upX, GLdouble upY, GLdouble upZ);
stands for:

Q2.I used blending function with GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
to remove little little small boxes on triangle's side
and i get success but rendering is too much slow when i
increased window size to full upto complete LCD screen
my GC configuration is
64MB VRAM
OpenGL 1.3 support



please help me cause i am a beginner(i know at a time every one begginer )

scratt
05-24-2009, 11:27 PM
One of the most valuable lessons you can learn as a beginner is to read the manual..
There is a very clear description of gluLookAt in the specs..
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/lookat.html

WRT Q2: Blending can slow your graphics down very quickly, especially if you have multiple layers of geometry and the polygons are full screen. If you are using it to remove artifacts from your polygons or textures then perhaps try a different approach that does not give you those artifacts in the first place. Then you don't need to blend.

What GPU do you have? This will have a massive effect on how much blending you can get away with as it's a very intensive task. As you increase the size of your view the GPU has to draw more pixels, which makes it slower, and every time you ask it to blend you are increasing the draw load by powers of 2 as the GPU has to reference previous pixels and merge them with the next layer of pixels and so on.. So every polygon drawn has much more processing done on it on a per pixel basis than non-blended polygons.

Here is a fairly good blending tutorial..
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08

Drawing order, and careful planning of your scene is really the only way to improve things.