Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. // filling normal buffer
  2. glBindBuffer( GL_ARRAY_BUFFER, normalBuffer );
  3. glBufferData( GL_ARRAY_BUFFER, currentMesh->m_NumVertices * sizeof(Cream::Math::Vector3f), currentMesh->m_Normals, GL_STATIC_DRAW );
  4.  
  5. // drawing
  6.  
  7. glEnableClientState( GL_NORMAL_ARRAY );
  8. glBindBuffer( GL_ARRAY_BUFFER, m_MeshData->m_VBOs[idx].m_Normals );
  9. glNormalPointer( GL_FLOAT, 0, 0 );
  10.  
  11. cglDrawElements( GL_TRIANGLES, currentMesh.m_NumFaces * 3, GL_UNSIGNED_INT, NULL );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement