// Solar.c
// OpenGL SuperBible
// Demonstrates OpenGL nested coordinate transformations
// and perspective
// Program by Richard S. Wright Jr.
/*原作者: Richard S. Wright Jr, 我在这里学习翻译一下 */
#include "../../Common/OpenGLSB.h" // System and OpenGL Stuff
#include <math.h>
// Lighting values
GLfloat whiteLight[] = { 0.2f, 0.2f, 0.2f, 1.0f };
GLfloat sourceLight[] = { 0.8f, 0.8f, 0.8f, 1.0f };
//光源位置
GLfloat lightPos[] = { 0.0f, 0.0f, 0.0f, 1.0f };
// 画场景的回调函数
void RenderScene(void)
{
// 地球和月亮旋转角度
static float fMoonRot = 0.0f;
static float fEarthRot = 0.0f;
// 清除颜色缓存和深度缓存
glClear(GL_COLOR