_math_matrix_analyse(ctx->ModelviewMatrixStack.Top);
}
TRANSFORM_DIRECTION(temp, params, ctx->ModelviewMatrixStack.Top->m);
- NORMALIZE_3FV(temp);
params = temp;
break;
case GL_SPOT_EXPONENT:
}
if (light->_Flags & LIGHT_SPOT) {
+ /* Note: we normalize the spot direction now */
+
if (ctx->_NeedEyeCoords) {
COPY_3V( light->_NormDirection, light->EyeDirection );
+ NORMALIZE_3FV( light->_NormDirection );
}
else {
+ GLfloat spotDir[3];
+ COPY_3V(spotDir, light->EyeDirection);
+ NORMALIZE_3FV(spotDir);
TRANSFORM_NORMAL( light->_NormDirection,
- light->EyeDirection,
+ spotDir,
ctx->ModelviewMatrixStack.Top->m);
}