>               // Clear to black
>               glClearColor(0.0,0.0,0.0,1.0);
>               glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

This will blow away lower layers that have already rendered.  Not exactly 
friendly in QC, but sometimes necessary I suppose.

>               // Set light position 
>               GLfloat light_position[] = { 0, 0, -WORLD_DIM_DEPTH*3 , 0.0 };
>               glLightfv(GL_LIGHT0, GL_POSITION, light_position);

This will break the lighting patch, which uses GL lighting.

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

This will blow away the Projection matrix, which QC uses to position things in 
QC coordinates.

>               
>               //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 */

This will blow away the Modelview matrix, which QC uses for 3D Transform among 
other things.

If you want to play nicely with QC's built-in patches, you need to modify the 
state they give you, not blow it away and replace it with your own.  If you do 
replace it with your own, don't expect QC to behave the same way - 
unfortunately, that's not possible.

You probably don't need to lock the GL context, either.

--
Christopher Wright
christopher_wri...@apple.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to