I’m trying to do some projection mapping stuff and having the problem illustrated in the attached image…
I want to project onto a plane that’s not square to the projector, so I’m drawing to an FBO then drawing the FBO texture bound to a quad that defines the mapping. It works, but there’s a distortion in the texturing, as shown in the image - it looks like openGL is turning the quad into 2 triangles so there’s a definite line running diagonally through the image.
I really need to get a more accurate mapping of the texture to the quad. Is there a way to ask openGL to use nicer stretching or something? I’m using ofxFBOTexture if that makes any difference…
Ah, cool. Will give the quad subdivision thing a go tomorrow morning. Weird how there’s nothing built in to openGL for that. Such is life… Thanks for the answer!
Thanks. CPU bound stuff isn’t really an option as there’s too much stuff going on on there at the moment. I’ve done the 10 x 10 approach, which is yielding pretty good results (not perfect, see the attached file).
I’ve put the code that does it below in case it helps anyone, although I think I’m doing it a bit long windedly and totally, totally inefficiently.
the method julapy post is not calculated in cpu, there’s one part that calculates a 4x4 matrix from the correspondance of the points, the calculations are pretty fast, in the order of microseconds, and once you have that everything else is done in cpu. haven’t tried the fbo aproach but can tell that the homography works really well.