Archived

This topic is now archived and is closed to further replies.

edotorpedo

glColor3i doesn't work?

Recommended Posts

Hi, simple question: Why do my tris turn out black when I write glColor3i(1,1,1) ? When I change it to glColor3f(1,1,1) opengl does draw the tris correctly? Does anyone have any thoughts on this? Thanks, Edo

Share this post


Link to post
Share on other sites
Because "Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to - 1.0. Floating-point values are mapped directly."

Share this post


Link to post
Share on other sites
[Stupid erroneous statement removed, see jenova's post below for the correct answer]

Hey, LilBudyWizer posted the FM just above, isn't that nice

[edited by - Yann L on June 6, 2002 6:55:41 PM]

Share this post


Link to post
Share on other sites
actually glColor3i, has the range [min(integer), max(integer)]. on the Win32 platform that would be [-2147483648, 2147483647].

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

[edited by - jenova on June 6, 2002 6:50:56 PM]

Share this post


Link to post
Share on other sites