Thanks for for prompt reply , although the <drawNode> method ( that I could
provide, here is the GL routine )
P.
-(void) renderGLScene: (CGLContextObj) cgl_ctx atTime:(NSTimeInterval)time
{
// Lock the Gl context
CGLLockContext(cgl_ctx);
// save our current GL state
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_TRANSFORM_BIT | GL_VIEWPORT_BIT);
//Set OpenGl state
{
// Clear to black
glClearColor(0.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Set light position
GLfloat light_position[] = { 0, 0, -WORLD_DIM_DEPTH*3 , 0.0 };
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
//Save & configure projection matrix
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPerspective(45, //view angle
aspect, //aspect ratio
1.0, //near clip
width*3.f);//far clip
//Save & configure model view matrix
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
gluLookAt(0.0, 0.0, width/aspect + self.inputZoom, /* eye is
at (0,0,5) */
0.0, 0.0, 0.0, /* center is at (0,0,0) */
0.0, 1.0, 0.); /* up is in positive Y
direction */
}
[self drawNodes: cgl_ctx atTime: time];
// Restore OpenGL states
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
// Restore OpenGl Attributs
glPopAttrib();
// Lock the gl contaxt
CGLUnlockContext(cgl_ctx);
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]