We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello!
The problem I'm having is already stated by someone else here: https://forum.processing.org/two/discussion/1842/opengl-mapping-texture-and-perspective
One of the suggested solutions is to divide the surface into triangle strips to reduce the effect. I tried that solution, it works and it is not what I am interested in, so I'm writing this post. What I'm interested in is the other suggested solution - to get OpenGL to use QUADS, how do I do that exactly?
I'm using Processing 3 and I know I have to do this:
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2ES2;
and something like this somewhere:
PJOGL pgl = (PJOGL) beginPGL();
GL2ES2 gl = pgl.gl.getGL2ES2();
but I'm not sure how to use that to achieve what I want.
Cheers,
Paolo
Answers
are you using processing 3?
the use of shaders seems to have fixed the texturing issue, at least based on the example i just tried (3.1.1):
even the textureCube example looks ok (despite the comment about P3D)
Thanks, but what about this? The problem persists.
ha, i initially didn't see a problem in that code because i was using horizontal stripes...
i've not tried the new opengl way but i can't see how it could possibly be any different because of how it's all triangle-based now. (previous versions of opengl had real quads). and using raw opengl is only going to get you the same as using processing vertexes.
( you've read this, yes? https://en.wikipedia.org/wiki/Texture_mapping#Affine_texture_mapping )
i think the only was around this would be subdividing the shape.
Okay, I get it. I thought there's a good opengl way of removing the effect of affine mapping (as suggested in the old thread), but I guess I'll stick to subdividing the shape.
a quick google turns up
https://bitlush.com/blog/arbitrary-quadrilaterals-in-opengl-es-2-0
not sure how useful this is.