PDA

View Full Version : OpenGL glScaled or glScaledf problem



DreamScape
11-23-2014, 11:09 PM
How do I stop is so that when the tly goes below zero everything doesn't turn upside down.

if (tly < 0)
{
glScalef(tly / 4, tly / 4, 0);
b.DrawBarChart(*columnHeadChar0, *columnHeadChar1, *columnHeadChar2, *columnHeadChar3, *columnHeadChar4, *columnHeadChar5,
columnTotal0, columnTotal1, columnTotal2, columnTotal3, columnTotal4, columnTotal5, 400, tlx, tly);
}
else
{
glScalef(tly / 4, tly / 4, 0);
b.DrawBarChart(*columnHeadChar0, *columnHeadChar1, *columnHeadChar2, *columnHeadChar3, *columnHeadChar4, *columnHeadChar5,
columnTotal0, columnTotal1, columnTotal2, columnTotal3, columnTotal4, columnTotal5, 400, tlx, tly);
}

GClements
11-24-2014, 03:45 PM
How do I stop is so that when the tly goes below zero everything doesn't turn upside down.
By not going below zero. What do you expect a negative scale factor to do?

Also, bear in mind that if an odd number of dimensions (i.e. 1 or 3) have a negative scale factor, the result will also be inside-out, so front faces will become back faces and normals will point inside rather than outside.