ubuntu+opengl 程序设计(5) 开始三维画图!
--lihn1987(转 载请著名作者)
哈哈,这次终于好绘制 3D图形啦~~~~~~
首先!上图!
再上代码!
// Points.c
// OpenGL SuperBible
// Demonstrates OpenGL Primative GL_POINTS
// Program by Richard S. Wright Jr.
#include <GL/glut.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
// Define a constant for the value of PI
#define GL_PI 3.1415f
// Rotation amounts
static GLfloat xRot = 0.0f ;
static GLfloat yRot = 0.0f ;
// Called to draw scene
void RenderScene( void )
{
GLfloat x,y,z,angle; // Storeage for coordinates and angles