OpenGL flip or mirror the drawing object -
how can flip, ot mirror up/left of image object, not screen in ondraw method?
i tried scale(1, -1, 1) not worked
my code:
opengl.selectvertex(vertexname) .translate(x-1, y, -9); if (opengl.getpathmodifier(vertexname).getangle()>-180 && opengl.getpathmodifier(vertexname).getangle()<0 ) { opengl.selectvertex(vertexname).scale(-scale,scale,1); } else { opengl.selectvertex(vertexname).scale(scale,scale,1); } opengl.rotate(opengl.getpathmodifier(vertexname).getangle()+90, 0, 0, 1);
not 100% sure you're asking here, think want transform projection matrix. if want flip things on left appear on right need scale projection matrix (-1, 1, 1). if want things @ top appear @ bottom need scale (1,-1, 1) , if want both can scale (-1, -1, 1).
edit based on information: if want display object same, texture flipped, need change texture coordinates of vertices in objects - flip texture coordinates replacing old u texture coordinate 1-u.
Comments
Post a Comment