OpenGL uses 0..1 values for most stuff, The api functions have variations indicating the type of the parameters e.g. glColor3f or glColor3d . If the vb wrappers are hiding this, a mistake is made very quickly indeed.
I use this class function to get the float values for OpenGL from LDraw lines.
I use this class function to get the float values for OpenGL from LDraw lines.
Code:
void init(const unsigned int rgb, const unsigned char alpha=255) {
r=(float)((rgb & 0xFF0000) >> 16)/255.0;
g=(float)((rgb & 0xFF00) >> 8)/255.0;
b=(float)(rgb & 0xFF)/255;
a=(float)alpha/255.0;
}