Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange behavior with glMaterialfv() between glBegin() and glEnd()



Help or comments needed.

I have a loop within a glBegin(GL_TRIANGLES)/glEnd() pair in which I draw several triangles. When I introduced glMaterialfv(GL_FRONT, GL_DIFFUSE, <color>) for each triangle within the loop, the triangles were rendered at what appears to be positions reflected about the x-y plane. Through NSLogs I confirmed that the vertices were as they should be. "<color>" is a float red[4], white[4], etc.

1. Commenting out the glMaterialfv() call results in a correctly rendered scene.
2. Changing the projection to orthographic results in an apparently correctly rendered scene though a z translation wouldn't show in my quick experiment. I haven't tried looking from another direction (in ortho) yet.
3. Making the glMaterialfv() call, then doing a glBegin()/glEnd() for each triangle results in a correctly rendered scene. A lot of overhead here - a begin/end for each triangle!
4. Rendering a triangle *without* a glMaterialfv call (in its own glBegin/glEnd pair) prior to rendering *with* glMaterialfv calls is okay(!). [something's being set/cleared?]

The red book says glMaterialfv() is okay between glBegin/glEnd. An example from opengl.org on the page http://www.opengl.org/developers/code/features/KilgardTechniques/ oglpitfall/oglpitfall.html in which glMaterialfv calls are made between glBegin/glEnd exhibits the same strange behavior when I paste it in my rendering loop.

I could find no examples (in devtools or elsewhere on the web other than cited above) where glMaterialfv is called between glBegin/glEnd.

I'm in process of more investigation to try to better isolate the behavior before I feel comfortable filing a bug report.

In the meantime, has anyone any experience with glMaterialfv calls between glBegin/glEnd, either successful or not? Does anyone know of any documentation addressing this potential bug?

Bruce J. Veazie
email@hidden
http://veazie.org
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.