   Nvidia CG example projects confuse me...
The fact that they are using glut makes it hard to understand some of the stuff that's going on below the surface. The main thing I'm trying to figure out right now is how the rendering step works. Would something like this work?glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadMatrixf((float*)&worldMat);cgGLBindProgram( Program );cgGLEnableProfile( Profile );glBindBuffer( GL_ARRAY_BUFFER, VertexBuffer );glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, IndexBuffer );glEnableClientState( GL_VERTEX_ARRAY );glEnableClientState( GL_NORMAL_ARRAY );glEnableClientState (GL_TEXTURE_COORD_ARRAY);glVertexPointer( 3, GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );glNormalPointer( GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );glTexCoordPointer( 2, GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (24)) );glDrawElements( GL_TRIANGLES, INDEX_COUNT, GL_UNSIGNED_INT, 0 );glDisableClientState( GL_VERTEX_ARRAY );glDisableClientState( GL_NORMAL_ARRAY );glDisableClientState( GL_TEXTURE_COORD_ARRAY );cgGLDisableProfile( Profile );SwapBuffers(hDC);The main thing the example projects fail to demonstrate is how to feed the vertex data into the shader. I'm new to OpenGL and CG.  I'm not sure if functions like glVertexPointer and others are actually defining the vertex data structure or if they only work on on the fixed function pipeline. However, if this is the current way to do it I can't understand how I am suppose to pass skinning data to the shader...   
   I'm not CG-user but how do you initialize your "VertexBuffer", "IndexBuffer" and "worldMat"?    ;  Well, I think there is something wrong in the calling order of your functions. This is called VBO (Vertex buffer object).Here is the correct order: (I didn't use cg before, so I didn't include it here)[source lang="cpp"]// 3 buffers, vertices, indices and normals (I didn't use texture but I guess it is the same)# define BUFFER_SIZE 2# define VERTICES_BUFFER 0# define INDICES_BUFFER 1GLuint buffersArray [ BUFFER_SIZE ];initialize ( ){// Instruct OpenGL to create the needed buffersglGenBuffers ( BUFFER_SIZE, buffersArray );initVertices ( );initIndices ( );}initVertices ( ){// Initialize your vertices here, read them from file, heightmap, ... etc// Now you need to bind the vertices buffer (This will make the buffersArray [ VERTICES_BUFFER ], the active current buffer, any buffers command will affect this buffer)glBindBuffer (GL_ARRAY_BUFFER, buffersArray [ VERTICES_BUFFER ] );// Upload your vertices to the buffer, the current buffer, which we just made it buffersArray [VERTICES_BUFFER]// Vertices and normals are GL_ARRAY_BUFFER while indices are GL_ELEMENT_ARRAY_BUFFER// GL_STATIC_DRAW, assuming your vertices are constant, their values won't change over frames (animation for example)glBufferData (GL_ARRAY_BUFFER, VERTICES_COUNT * sizeof(vertexDataStructure), verticesArray, GL_STATIC_DRAW );}initIndices ( ){// Same as vertices, initialize your indices (usually unsinged int or unsinged short)glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, buffersArray [ INDICES_BUFFER ] );glBufferData (GL_ELEMENT_ARRAY_BUFFER, INDICES_COUNT * sizeof(unsigned int), indices, GL_STATIC_DRAW );}draw ( ){// Activate verticesBufferglBindBuffer( GL_ARRAY_BUFFER, buffersArray [ VERTICES_BUFFER] );// Tell OpenGL how to obtain vertices coordinates (x,y,z) from the current buffer glVertexPointer( 3, GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );// Tell OpenGL how to obtain normals data from the active bufferglNormalPointer( GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );// You don't have to bind index buffer//glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, buffersArray [ INDICES_BUFFER] );glEnableClientState( GL_VERTEX_ARRAY );glEnableClientState( GL_NORMAL_ARRAY );// I think there is something wrong about the 2nd parameter, not sureglDrawElements( GL_TRIANGLES, INDEX_COUNT, GL_UNSIGNED_INT, 0 );glDisableClientState( GL_VERTEX_ARRAY );glDisableClientState( GL_NORMAL_ARRAY );}[/source]Instead of calling this part in your draw() function (Not 100% sure about this, but it works with me):[source lang="cpp"]// Activate verticesBufferglBindBuffer( GL_ARRAY_BUFFER, buffersArray [ VERTICES_BUFFER] );// Tell OpenGL how to obtain vertices coordinates (x,y,z) from the current buffer glVertexPointer( 3, GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );// Tell OpenGL how to obtain normals data from the active bufferglNormalPointer( GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );[/source]you can just call those in your initVertices() after uploading vertices data:[source lang="cpp"]glVertexPointer( 3, GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );glNormalPointer( GL_FLOAT, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );[/source]I use GLSL, so, before calling glDrawElements I just call glUseProgram(myShadersProgram). There are many tutorials about VBO, I recommend reading them, they explain more about parameters, also try to check any OpenGL reference cuz I wrote this from memory, some parameters may be missing or wrong. Hope it helps.   ;Alright I did a bit of research and think I have this part right:cgGLEnableProfile( Profile );glBindBuffer( GL_ARRAY_BUFFER, VertexBuffer );glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, IndexBuffer );glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );glVertexAttribPointer( 2, 2, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (24)) );glVertexAttribPointer( 3, 4, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (32)) );glVertexAttribPointer( 4, 4, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (48)) );glEnableVertexAttribArray( 0 );glEnableVertexAttribArray( 1 );glEnableVertexAttribArray( 2 );glEnableVertexAttribArray( 3 );glEnableVertexAttribArray( 4 );cgGLBindProgram( Program );glDrawElements( GL_TRIANGLES, INDEX_COUNT, GL_UNSIGNED_INT, 0 );glDisableVertexAttribArray( 0 );glDisableVertexAttribArray( 1 );glDisableVertexAttribArray( 2 );glDisableVertexAttribArray( 3 );glDisableVertexAttribArray( 4 );cgGLDisableProfile( Profile );Oddly when I run this code it does not crash and renders using the default fixed function rendering system even though the Program and Profile have not been properly set up... I'm going to try to get a shader working but if anyone knows why it's working even though the Profile and Program variables are not set up I would really like to know!   ;Alright I did a bit of research and think I have this part right:cgGLEnableProfile( Profile );glBindBuffer( GL_ARRAY_BUFFER, VertexBuffer );glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, IndexBuffer );glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (0)) );glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (12)) );glVertexAttribPointer( 2, 2, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (24)) );glVertexAttribPointer( 3, 4, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (32)) );glVertexAttribPointer( 4, 4, GL_FLOAT, GL_FALSE, sizeof(Ovgl::Vertex), ((char *)NULL + (48)) );glEnableVertexAttribArray( 0 );glEnableVertexAttribArray( 1 );glEnableVertexAttribArray( 2 );glEnableVertexAttribArray( 3 );glEnableVertexAttribArray( 4 );cgGLBindProgram( Program );glDrawElements( GL_TRIANGLES, INDEX_COUNT, GL_UNSIGNED_INT, 0 );glDisableVertexAttribArray( 0 );glDisableVertexAttribArray( 1 );glDisableVertexAttribArray( 2 );glDisableVertexAttribArray( 3 );glDisableVertexAttribArray( 4 );cgGLDisableProfile( Profile );Oddly when I run this code it does not crash and renders using the default fixed function rendering system even though the Program and Profile have not been properly set up... I'm going to try to get a shader working but if anyone knows why it's working even though the Profile and Program variables are not set up I would really like to know!Can you try to comment out this line "glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, IndexBuffer );" . Also check the return code of cgGLBindProgram( Program ).   