nousername19 0 Newbie Poster

Hey

I have a problem regarding skewness of non square objects when i scale them with respect to screen size and then rotate them in an orthographic view on the z axis. This is my code for setting it up to draw. The problem i am facing is that when i rotate some rectangle, the image gets skewed,the height and width of the texture i am using changes. Can someone tell me what i am doing wrong?

glViewport(0,0, (GLint)screenWidth, (GLint)screenHeight);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

glOrthof(-1,1,-1,1,-1,1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glPushMatrix();

glTranslatef(positionX, positionY,0.0f);

glScalef(scaleX , scaleY ,1);

glRotatef(rotationZ, 0.0f, 0.0f, 1.0f);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.