32 static GLfloat lightPosition[] = {0.0f, 0.0f, 1.0f, 0.0f};
33 static GLfloat lightAmbient[] = {0.1f, 0.1f, 0.1f, 1.0f};
34 static GLfloat lightDiffuse[] = {0.8f, 0.8f, 0.8f, 1.0f};
35 static GLfloat lightSpecular[] = {0.8f, 0.8f, 0.8f, 1.0f};
38 static GLfloat materialAmbient[] = {0.2f, 0.2f, 0.2f, 1.0f};
39 static GLfloat materialDiffuse[] = {0.8f, 0.8f, 0.8f, 1.0f};
40 static GLfloat materialSpecular[] = {0.5f, 0.5f, 0.5f, 1.0f};
41 static GLint materialShininess = 64;
64 const eq::uint128_t
id = frameData->getModelID();
65 const Model* model = application.getModel(
id );
71 glLightfv( GL_LIGHT0, GL_POSITION, lightPosition );
72 glLightfv( GL_LIGHT0, GL_AMBIENT, lightAmbient );
73 glLightfv( GL_LIGHT0, GL_DIFFUSE, lightDiffuse );
74 glLightfv( GL_LIGHT0, GL_SPECULAR, lightSpecular );
76 glMaterialfv( GL_FRONT, GL_AMBIENT, materialAmbient );
77 glMaterialfv( GL_FRONT, GL_DIFFUSE, materialDiffuse );
78 glMaterialfv( GL_FRONT, GL_SPECULAR, materialSpecular );
79 glMateriali( GL_FRONT, GL_SHININESS, materialShininess );
83 glColor3f( .75f, .75f, .75f );
89 const eq::Matrix4f projection = frustum.compute_matrix();
90 const eq::Matrix4f pmv = projection * view * modelM;
93 _state->setProjectionModelViewMatrix( pmv );
95 _state->setColors( model->hasColors( ));
97 model->cullDraw( *_state );
The context applied to a channel during rendering operations.
virtual void applyModelMatrix()
Apply the current model matrix to OpenGL.
const RenderContext & getRenderContext() const
virtual bool init(co::Object *initData)
Initialize the renderer.
virtual void draw(co::Object *frameData)
Render the scene.
const Frustumf & getFrustum() const
const GLEWContext * glewGetContext() const
Get the GLEW context for this renderer.
Range range
database-range wrt to dest channel
Application & getApplication()
const Matrix4f & getViewMatrix() const
virtual bool exit()
De-initialize the renderer.
virtual bool init(co::Object *initData)
Initialize the renderer.
virtual void applyRenderContext()
Apply the current rendering parameters to OpenGL.
const Matrix4f & getModelMatrix() const
virtual bool exit()
De-initialize the renderer.
float start
The start position.