protected virtual void initRenderingGL() { if (m_uint_DC == 0 || m_uint_RC == 0) { return; } GL.glShadeModel(GL.GL_SMOOTH); GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); GL.glClearDepth(1.0f); GL.glEnable(GL.GL_LIGHT0); GL.glEnable(GL.GL_COLOR_MATERIAL); GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); GL.glEnable(GL.GL_DEPTH_TEST); GL.glDepthFunc(GL.GL_LEQUAL); GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST); GL.glViewport(0, 0, Width, Height); GL.glClearColor(0, 0, 0, 0); GL.glMatrixMode(GL.GL_PROJECTION); GL.glLoadIdentity(); GLU.gluPerspective(45.0, 1.0, 1.0, 1000.0); GL.glMatrixMode(GL.GL_MODELVIEW); GL.glLoadIdentity(); GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedTraslations); InitTexture("SurgeryRoom.bmp"); }
public void initRenderingGL() { if (m_uint_DC == 0 || m_uint_RC == 0) { return; } if (this.Width == 0 || this.Height == 0) { return; } GL.glShadeModel(GL.GL_SMOOTH); GL.glClearColor(1.0f, 1.0f, 1.0f, 0.0f); GL.glClearDepth(1.0f); GL.glEnable(GL.GL_LIGHT0); GL.glEnable(GL.GL_COLOR_MATERIAL); GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); // GL.GL_AMBIENT_AND_DIFFUSE / GL.GL_SHININESS //GL.glEnable(GL.GL_DEPTH_TEST); GL.glDepthFunc(GL.GL_LEQUAL); GL.glViewport(0, 0, this.Width, this.Height); GL.glMatrixMode(GL.GL_PROJECTION); GL.glLoadIdentity(); GLU.gluPerspective(45, ((double)Width) / Height, 1.0, 1000.0); GL.glMatrixMode(GL.GL_MODELVIEW); //save the current MODELVIEW Matrix (now it is Identity) //GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations); InitTexture("IMG\\1.bmp"); }
protected virtual void initRenderingGL() { if (m_uint_DC == 0 || m_uint_RC == 0) { return; } if (this.Width == 0 || this.Height == 0) { return; } GL.glShadeModel(GL.GL_SMOOTH); GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); GL.glClearDepth(1.0f); GL.glEnable(GL.GL_LIGHT0); GL.glEnable(GL.GL_COLOR_MATERIAL); GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); GL.glEnable(GL.GL_DEPTH_TEST); GL.glDepthFunc(GL.GL_LEQUAL); GL.glHint(GL.GL_PERSPECTIVE_CORRECTION_Hint, GL.GL_NICEST); GL.glViewport(0, 0, this.Width, this.Height); GL.glMatrixMode(GL.GL_PROJECTION); GL.glLoadIdentity(); //nice 3D GLU.gluPerspective(45.0, 1.0, 0.4, 100.0); //! TEXTURE 1a GL.glEnable(GL.GL_COLOR_MATERIAL); float[] emis = { 0.3f, 0.3f, 0.3f, 1 }; GL.glMaterialfv(GL.GL_FRONT_AND_BACK, GL.GL_EMISSION, emis); //! TEXTURE 1a GL.glShadeModel(GL.GL_SMOOTH); GLU.gluPerspective(viewAngle, (float)Width / (float)Height, 0.45f, 30.0f); GL.glMatrixMode(GL.GL_MODELVIEW); GL.glLoadIdentity(); //! TEXTURE 1a GenerateTextures(); //! TEXTURE 1b //save the current MODELVIEW Matrix (now it is Identity) GL.glGetDoublev(GL.GL_MODELVIEW_MATRIX, AccumulatedRotationsTraslations); }
protected virtual void initRenderingGL() { if (m_uint_DC == 0 || m_uint_RC == 0) { return; } if (this.Width == 0 || this.Height == 0) { return; } GL.glShadeModel(GL.GL_SMOOTH); GL.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); GL.glClearDepth(1.0f); if (GlobalProperties.LightBeamOn) { GL.glEnable(GL.GL_LIGHT0); } GL.glEnable(GL.GL_COLOR_MATERIAL); GL.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); GL.glEnable(GL.GL_DEPTH_TEST); GL.glDepthFunc(GL.GL_LEQUAL); GL.glViewport(0, 0, this.Width, this.Height); GL.glClearColor(0, 0, 0, 0); GL.glMatrixMode(GL.GL_PROJECTION); GL.glLoadIdentity(); GLU.gluPerspective(90.0, ((double)Width) / Height, 1.0, 1000.0); GL.glMatrixMode(GL.GL_MODELVIEW); GL.glLoadIdentity(); GenerateTextures(); }