資源簡(jiǎn)介
利用OpenGL做了一個(gè)月球圍繞地球轉(zhuǎn)的動(dòng)畫,月球和地球同時(shí)也在自轉(zhuǎn).設(shè)計(jì)到的技術(shù)有貼圖,光照,讀入外部圖像.其中,讀入外部圖像使用的是GLaux庫(kù).本代碼生成exe所需要庫(kù)和頭文件也一并放在里面
代碼片段和文件信息
/******************************
**?title:?earth?and?moon
**?Author:?王勐?09008211
**?Date:2010-12-11
******************************/
#include?
#include?
#include?
#include?
#include?
#include?
#pragma?comment(lib?“glaux.lib“);
/*?animation?definition??*/
const?double?pi=3.1415926535897932384626433832795;
const?double?d=0.1; //?lighting‘s?angel?change?d?for?each?‘a(chǎn)‘?or?‘d‘?pressed?
const?double?moonRotaV?=?10; //?speed?of?moon‘s?rotation
const?double?sunR?=?600; //?distance?from?sun?to?earth
const?double?moonRa?=?500; //?the?major?semi?axis?of?the?orbit?of?moon
const?double?moonRb?=?300; //?the?minor?semi?axis?of?the?orbit?of?moon
double?theta?=?0; //?of?lighting?changed?by?key?‘a(chǎn)‘?or?‘d‘
do
評(píng)論
共有 條評(píng)論