Thank you ZbuffeR!
scooppic is write by C programmer.
I have the source code, and can modify myself.
The part of the source code is list below.
If need more details please tell me.
/**************************************************
* snowpic.c: make cross-section of snow sample *
**************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<OpenGL/gl.h>
#include<GLUT/glut.h>
#include"visualvar.h"
#include"InitVars.c"
#include"ReadInitialFile.c"
#include"ChoosePerspective.c"
#include"DrawObjects.c"
#include"KeyboardFunctions.c"
#include"MouseFunctions.c"
static void Idle( void )
{
glutPostRedisplay();
// DumpImage(xpixel,ypixel);
}
void Display( void )
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho (left,right,bottom,top,near,far);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
gluLookAt(eyex,eyey,eyez,xview,yview,zview,vupx,vupy,vupz);
glPushMatrix();
// DrawBackGround();
DrawScoop();
DrawGrains();
glPopMatrix();
glutSwapBuffers();
}
static void Reshape( int width, int height )
{
glViewport( 0, 0, width, height );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho (left, right, bottom*(GLfloat)height/(GLfloat)width,
top*(GLfloat)height/(GLfloat)width,near,far);
}
static void Init( void )
{
// GLfloat light_position[] = { -10.0, -10.0, 0.0, 1.0 };
// GLfloat lm_ambient[] = { 0.55, 0.55, 0.55, 1.0 };
GLfloat light_position[] = { 10.0, -10.0, 10.0, 1.0 };
// GLfloat lm_ambient[] = { 0.65, 0.65, 0.65, 1.0 };
GLfloat lm_ambient[] = { 0.3, 0.3, 0.3, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lm_ambient);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
// glShadeModel (GL_FLAT);
glShadeModel (GL_SMOOTH);
glClearColor(0.8, 0.9, 1.0, 0.1);
}
int main( int argc, char *argv[] )
{
strcpy(infile1, argv[1]);
strcpy(infile2, argv[2]);
InitVars();
strcpy(windowname, argv[1]);
ReadInitialFile();
ChoosePerspective();
glutInit( &argc, argv );
glutInitWindowSize(xpixel,ypixel);
glutInitWindowPosition(50,50);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
glutCreateWindow(windowname);
Init();
glutReshapeFunc( Reshape );
glutDisplayFunc( Display );
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutIdleFunc( Idle );
glutMainLoop();
return 0;
}