Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void RenderVertexForGL (const CVertex & v)
- {
- glColor4f (v.m_Color.r, v.m_Color.g, v.m_Color.b, v.m_Color.a);
- glTexCoord2f (v.m_TexCoord.x, v.m_TexCoord.y);
- glNormal3f (v.m_Normal.x, v.m_Normal.y, v.m_Normal.z);
- glVertex3f (v.m_Position.x, v.m_Position.y, v.m_Position.z);
- }
- void CTerrain::Render ()
- {
- // ...
- // Render the terrain
- // y
- for (int i = 0; i < size-1; i++)
- {
- glBegin (GL_TRIANGLE_STRIP);
- //glBegin (GL_LINES);
- // x
- for (int ii = 0; ii < size; ii++)
- {
- const CVertex
- & v1 = vertices [size*i + ii],
- & v2 = vertices [size*(i+1) + ii];
- RenderVertexForGL (v1);
- RenderVertexForGL (v2);
- }
- glEnd ();
- }
- // ...
- }
Add Comment
Please, Sign In to add comment