rem: calcVertexNormals( dcast<GeometryPtr>(objects[3]->getCore()) );
add: OSG::GeometryPtr pGeo = dcast<GeometryPtr>(objects[3]->getCore()); calcVertexNormals(pGeo);
context: int main (int argc, char **argv){	// GLUT init    osgInit(argc, argv);	glutInit(&argc, argv);	glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);	glutCreateWindow("OpenSG");	glutKeyboardFunc(key);	glutReshapeFunc(resize);	glutDisplayFunc(display);       	// glutMouseFunc(mouse);   	// glutMotionFunc(motion); 		glutIdleFunc(display);	glMatrixMode( GL_PROJECTION );	glLoadIdentity();	gluPerspective( 60, 1, 0.1, 10 );	glMatrixMode( GL_MODELVIEW );	glLoadIdentity();	gluLookAt( 3, 3, 3,  0, 0, 0,   0, 0, 1 );		glPointSize( 3 );		glEnable( GL_DEPTH_TEST );	glEnable( GL_LIGHTING );	glEnable( GL_LIGHT0 );	// OSG		// create a material (need that to test textures)		SimpleMaterialPtr mat;			mat = SimpleMaterial::create();	mat->setDiffuse( Color3f( 1,.8,.8 ) );	mat->setAmbient( Color3f( 0.1,0.1,0.1 ) );	mat->setSpecular( Color3f( 1,1,1 ) );	mat->setShininess( 20 );	// Texture chunk		UChar8 imgdata[] = 		{  255,0,0,0,  0,255,0,0,  0,0,255,255,  255,255,255,255 };	Image image( Image::OSG_RGBA_PF, 2, 2, 1, 1, 1, 0, imgdata );	if ( argc > 1 )		image.read( argv[1] );		TextureChunkPtr xchunk;	xchunk = TextureChunk::create();	xchunk->setImage( &image );	xchunk->setMinFilter( GL_NEAREST );	xchunk->setMagFilter( GL_NEAREST );	xchunk->setWrapS( GL_REPEAT );	xchunk->setWrapT( GL_REPEAT );	xchunk->setEnvMode( GL_MODULATE );	mat->addChunk( xchunk );	// create the objects	objects[0] = makePlane( 2, 2, 2, 2 );	dcast<GeometryPtr>(objects[0]->getCore())->setMaterial( mat );	cerr << "Plane Node: " << hex << objects[0] << endl;	objects[1] = makeCone( 2.5, 2, 20, true, true );	dcast<GeometryPtr>(objects[1]->getCore())->setMaterial( mat );	cerr << "Cone Node: " << hex << objects[1] << endl;	objects[2] = makeTorus( .6, 2, 8, 16 );	dcast<GeometryPtr>(objects[2]->getCore())->setMaterial( mat );	cerr << "Torus Node: " << hex << objects[2] << endl;	objects[3] = makeSphere( 1, 2 );	dcast<GeometryPtr>(objects[3]->getCore())->setMaterial( mat );	cerr << "Sphere Node: " << hex << objects[3] << endl;		objects[4] = makeCylinder( 3, 2, 20, true, true, true );	dcast<GeometryPtr>(objects[4]->getCore())->setMaterial( mat );	cerr << "Cylinder Node: " << hex << objects[4] << endl;		objects[5] = makeConicalFrustum( 3, 2, 1, 20, true, true, true );	dcast<GeometryPtr>(objects[5]->getCore())->setMaterial( mat );	cerr << "Frustum Node: " << hex << objects[5] << endl;		// try the vertex normal calc	calcVertexNormals( dcast<GeometryPtr>(objects[3]->getCore()) );		// The action	WindowPtr win = GLUTWindow::create();	dact = DrawAction::create();	dact->setWindow( win.getCPtr() );	glutMainLoop();	    return 0;}