-
大小: 7KB文件類型: .rar金幣: 2下載: 0 次發布日期: 2021-05-24
- 語言: C/C++
- 標簽:
資源簡介
利用opengl 組件的基礎上使用VC++編寫的球體光照模型

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#define?PI_OVER_180????0.01745329F
#define?DEG2RAD(?a?)???(?(a)?*?PI_OVER_180?)
#define?ELEMENTS_PER_VERTEX?3
#define?ELEMENTS_PER_NORMAL?3
#define?BYTES_PER_CACHELINE?32
/*?struct?used?to?manage?color?ramps?*/
struct?colorIndexState?{
????GLfloat?amb[3]; /*?ambient?color?/?bottom?of?ramp?*/
????GLfloat?diff[3]; /*?diffuse?color?/?middle?of?ramp?*/
????GLfloat?spec[3]; /*?specular?color?/?top?of?ramp?*/
????GLfloat?ratio; /*?ratio?of?diffuse?to?specular?in?ramp?*/
????GLint?indexes[3]; /*?where?ramp?was?placed?in?palette?*/
};
#define?NUM_COLORS?(sizeof(s_colors)?/?sizeof(s_colors[0]))
struct?colorIndexState?s_colors[]?=?{
????{
????????{?0.0F?0.0F?0.0F?}
????????{?1.0F?0.0F?0.0F?}
????????{?1.0F?1.0F?1.0F?}
????????0.75F?{?0?0?0?}
????}
????{
????????{?0.0F?0.05F?0.05F?}
????????{?0.9F?0.0F?1.0F?}
????????{?1.0F?1.0F?1.0F?}
????????1.0F?{?0?0?0?}
????}
????{
????????{?0.0F?0.0F?0.0F?}
????????{?1.0F?0.9F?0.1F?}
????????{?1.0F?1.0F?1.0F?}
????????0.75F?{?0?0?0?}
????}
????{
????????{?0.0F?0.0F?0.0F?}
????????{?0.1F?1.0F?0.9F?}
????????{?1.0F?1.0F?1.0F?}
????????0.75F?{?0?0?0?}
????}
};
static?void?(APIENTRY?*LockArraysSGI)(GLint?first?GLsizei?count);
static?void?(APIENTRY?*UnlockArraysSGI)(void);
static?void?(APIENTRY?*CullParameterfvSGI)(?GLenum?pname?GLfloat?*params?);
static?GLint?s_lit_tex_indexes[3];
static?int?s_num_rows?=?16;
static?int?s_num_cols?=?16;
static?int?s_winwidth??=?320;
static?int?s_winheight?=?240;
#define?MS_TO_RENDER???????5000
#define?DRAW_VERTEX3FV??????????0
#define?DRAW_DRAW_ELEMENTS??????1
#define?DRAW_DRAW_ARRAYS????????2
#define?DRAW_ARRAY_ELEMENT??????3
static?const?char?*s_class_name??=?“GL?Sphere“;
static?const?char?*s_window_name?=?“GL?Sphere“;
static?BOOL????s_rgba????????=?TRUE;
static?BOOL????s_lighting????=?TRUE;
static?BOOL????s_benchmark???=?FALSE;
static?BOOL????s_remote??????=?FALSE;
static?BOOL????s_lock_arrays?=?TRUE;
static?BOOL????s_vcull???????=?TRUE;
static?HPALETTE?s_hPalette?=?NULL;
static?HWND?????s_hWnd??=?NULL;
static?HGLRC????s_hglrc?=?NULL;
static?HDC??????s_hDC???=?NULL;
static?int??????s_bpp???=?8;
static?int??????s_draw_method?=?DRAW_VERTEX3FV;
static?unsigned?long?s_vertices_processed?=?0L;
static?unsigned?long?s_triangles_processed?=?0L;
static?float?????????s_elapsed_time;
static?unsigned?long?s_start?s_stop;
/*
**?this?maintains?the?data?for?drawing?stuff?via?tristrips
*/
static?float?**s_sphere_points;
static?float?**s_sphere_normals;
/*
**?this?maintains?the?data?for?drawing?stuff?via?vertex?arrays?and?array?elements
*/
static?float??*s_sphere_point_array;
static?float??*s_sphere_normal_array;
/*
**?this?stores?the?data?for?drawing?stuff?using?interleaved?arrays?with
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????407??1997-10-31?02:18??sphere\makefile
?????文件??????30372??1997-11-21?16:55??sphere\sphere.c
?????目錄??????????0??2010-05-30?20:00??sphere
-----------?---------??----------?-----??----
????????????????30779????????????????????3
- 上一篇:0-1背包問題C語言源碼
- 下一篇:MFC編寫的五子棋程序源代碼
評論
共有 條評論