Simple renderer in .net with SharpGL (openGL)


Re: Simple renderer in .net with SharpGL (openGL)
#40
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.

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;
}
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Re: Simple renderer in .net with SharpGL (openGL) - by Roland Melkert - 2013-12-02, 18:05

Forum Jump:


Users browsing this thread: 13 Guest(s)