PhotonicDude

10-30-2003, 12:31 PM

Hi all, I have a question/observation and I'd like feedback if you have seen this or know a way to around this problem...

When using glTranslated(x,y,z) or glScaled(x,y,z) with identity matrices, my 4*4 resulting matricies are clean (where x,y,z have all decimal values after the point equal to 0 ( ex:4.0) , the resulting matrix multiplication gives a matrix that has also clean values).

Yet when I use the (ex) glRotated(90.0f,0.0f, 1.0f, 0.0f) on the identity matrix,

(the resulting multiplication:

[c 0 s 0]

[0 1 0 0]

[-s 0 c 0]

[0 0 0 1]

c is for cos(angle) and s for sin(angle)

I seem to observe that "s" values are clean values but the "c" values have garbage after the 7th decimal point... I observe this when angle is factor of pi/2 (90deg) for c and s but not with angle = 0;

In this example Cos(90)(or c) should be 0.0,

but I have -0.000000437....

Is this normal with OpenGL ?

Thanks again, PhotonD

When using glTranslated(x,y,z) or glScaled(x,y,z) with identity matrices, my 4*4 resulting matricies are clean (where x,y,z have all decimal values after the point equal to 0 ( ex:4.0) , the resulting matrix multiplication gives a matrix that has also clean values).

Yet when I use the (ex) glRotated(90.0f,0.0f, 1.0f, 0.0f) on the identity matrix,

(the resulting multiplication:

[c 0 s 0]

[0 1 0 0]

[-s 0 c 0]

[0 0 0 1]

c is for cos(angle) and s for sin(angle)

I seem to observe that "s" values are clean values but the "c" values have garbage after the 7th decimal point... I observe this when angle is factor of pi/2 (90deg) for c and s but not with angle = 0;

In this example Cos(90)(or c) should be 0.0,

but I have -0.000000437....

Is this normal with OpenGL ?

Thanks again, PhotonD