Hi, I'm new here and to OpenGL. My question is this: Is there a way to get the color of a vertex(or point if you will) on a texture that is on one of the backfaces of a polygon?
Hi, I'm new here and to OpenGL. My question is this: Is there a way to get the color of a vertex(or point if you will) on a texture that is on one of the backfaces of a polygon?
Benjamin Barrett aka vindy
"Our knowledge is finite, while our ignorance is infinite!"
Render back faces only ?
Not sure of what you are trying to do...
Umm, I'm not sure how else to put it. I've got a cube whose faces are textured. This cube rotates. I want to grab the color at a point that is on one of the backfaces at will. I'm not looking to grab the color of a pixel on the screen but rather a backface vertex that isn't drawn on the screen because you can't see it. I know this is confusing. If you like I will try to explain further.
Benjamin Barrett aka vindy
"Our knowledge is finite, while our ignorance is infinite!"
Render the back faces using glCullFace(GL_FRONT)
Then use glReadPixels to read back the backbuffer to obtain the colour at the screen coordinate.
As said, render back faces only (by culling front faces)
http://www.opengl.org/sdk/docs/man/xhtml/glCullFace.xml
You only need to do that at the moment you need to grab it, and you don't need to show it to the user (don't swap). glReadPixels, then glClear, then back to backface culling, then normal render, then swapbuffers.
Thanks! I wouldn't have thought of that.![]()
Benjamin Barrett aka vindy
"Our knowledge is finite, while our ignorance is infinite!"