91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.25MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-24
  • 語言: 其他
  • 標簽: Nate??Robin??OpenGL??

資源簡介

OpenGL編程指南中提到的教程-Nate Robin的OpenGL教程

資源截圖

代碼片段和文件信息

/*
????fog.c
????Nate?Robins?1997

????Tool?for?teaching?about?OpenGL?fog.
????
*/


#include?
#include?
#include?
#include?
#include?
#include?“glm.h“


typedef?struct?_cell?{
????int?id;
????int?x?y;
????float?min?max;
????float?value;
????float?step;
????char*?info;
????char*?format;
}?cell;


cell?color[4]?=?{
????{?1?180?40?0.0?1.0?0.7?0.005
????????“Specifies?red?component?of?fog?color.“?“%.2f“?}
????{?2?240?40?0.0?1.0?0.7?0.005?
????“Specifies?green?component?of?fog?color.“?“%.2f“?}
????{?3?300?40?0.0?1.0?0.7?0.005?
????“Specifies?blue?component?of?fog?color.“?“%.2f“?}
????{?4?360?40?0.0?1.0?1.0?0.005?
????“Specifies?alpha?component?of?fog?color.“?“%.2f“?}
};

cell?density?=?{?5?260?120??0.0?3.0?1.0?0.01?
“Specifies?the?near?distance.“?“%.2f“?};
cell?fstart??=?{?6?240?120?-3.0?3.0?0.5?0.01?
“Specifies?the?far?distance.“?“%.2f“?};
cell?fend????=?{?7?240?160?-3.0?3.0?2.0?0.01
“Specifies?the?fog?density.“?“%.2f“?};

GLenum?mode?=?GL_LINEAR;

GLboolean?clear?=?GL_TRUE;
GLMmodel*?pmodel?=?NULL;


GLfloat?eye[3]?=?{?0.5?0.25?1.5?};
GLfloat?at[3]??=?{?0.0?-0.25?0.0?};
GLfloat?up[3]??=?{?0.0?1.0?0.0?};

void?redisplay_all(void);
GLuint?window?world?screen?command;
GLuint?sub_width?=?256?sub_height?=?256;
GLint?selection?=?0;


GLvoid?*font_style?=?GLUT_BITMAP_TIMES_ROMAN_10;

void
setfont(char*?name?int?size)
{
????font_style?=?GLUT_BITMAP_HELVETICA_10;
????if?(strcmp(name?“helvetica“)?==?0)?{
????????if?(size?==?12)?
????????????font_style?=?GLUT_BITMAP_HELVETICA_12;
????????else?if?(size?==?18)
????????????font_style?=?GLUT_BITMAP_HELVETICA_18;
????}?else?if?(strcmp(name?“times?roman“)?==?0)?{
????????font_style?=?GLUT_BITMAP_TIMES_ROMAN_10;
????????if?(size?==?24)
????????????font_style?=?GLUT_BITMAP_TIMES_ROMAN_24;
????}?else?if?(strcmp(name?“8x13“)?==?0)?{
????????font_style?=?GLUT_BITMAP_8_BY_13;
????}?else?if?(strcmp(name?“9x15“)?==?0)?{
????????font_style?=?GLUT_BITMAP_9_BY_15;
????}
}

void?
drawstr(GLuint?x?GLuint?y?char*?format?...)
{
????va_list?args;
????char?buffer[255]?*s;
????
????va_start(args?format);
????vsprintf(buffer?format?args);
????va_end(args);
????
????glRasterPos2i(x?y);
????for?(s?=?buffer;?*s;?s++)
????????glutBitmapCharacter(font_style?*s);
}

void
cell_draw(cell*?cell)
{
????glColor3ub(0?255?128);
????if?(selection?==?cell->id)?{
????????glColor3ub(255?255?0);
????????drawstr(10?240?cell->info);
????????glColor3ub(255?0?0);
????}
????
????drawstr(cell->x?cell->y?cell->format?cell->value);
}

int
cell_hit(cell*?cell?int?x?int?y)
{
????if?(x?>?cell->x?&&?x?x?+?60?&&
????????y?>?cell->y-30?&&?y?y+10)
????????return?cell->id;
????return?0;
}

void
cell_update(cell*?cell?int?update)
{
????if?(selection?!=?cell->id)
????????return;
????
????cell->value?+=?update?*?cell->step;
????
????if?(cell->value?min)
????????cell->value?=?cell->min;
????else?if?(cel

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2005-11-07?04:19??tutors\data\
?????目錄???????????0??2005-11-07?04:19??tutors\tutors.vc6\
?????目錄???????????0??2005-11-07?04:27??tutors\tutors.vsnetproj\
?????目錄???????????0??2005-11-07?04:19??tutors\tutors.xcodeproj\
?????文件???????12754??2005-11-07?04:19??tutors\fog.c
?????文件???????73728??2005-11-07?04:27??tutors\fog.exe
?????文件???????66463??2005-11-07?04:19??tutors\glm.c
?????文件???????10176??2005-11-07?04:19??tutors\glm.h
?????文件??????237568??2001-11-08?09:27??tutors\glut32.dll
?????文件???????42283??2005-11-07?04:19??tutors\lightmaterial.c
?????文件???????98304??2005-11-07?04:27??tutors\lightmaterial.exe
?????文件???????20769??2005-11-07?04:19??tutors\lightposition.c
?????文件???????77824??2005-11-07?04:27??tutors\lightposition.exe
?????文件????????1542??2005-11-07?04:19??tutors\Makefile
?????文件????????3256??2005-11-07?04:19??tutors\materials.h
?????文件???????24516??2005-11-07?04:19??tutors\projection.c
?????文件???????77824??2005-11-07?04:27??tutors\projection.exe
?????文件???????56171??2005-11-07?04:19??tutors\shapes.c
?????文件???????73728??2005-11-07?04:27??tutors\shapes.exe
?????文件???????35888??2005-11-07?04:19??tutors\texture.c
?????文件???????81920??2005-11-07?04:27??tutors\texture.exe
?????文件???????19117??2005-11-07?04:19??tutors\transformation.c
?????文件???????77824??2005-11-07?04:27??tutors\transformation.exe
?????文件????????1747??2005-11-07?04:19??tutors\data\al.mtl
?????文件??????186752??2005-11-07?04:19??tutors\data\al.obj
?????文件???????49181??2005-11-07?04:19??tutors\data\checker.ppm
?????文件?????????342??2005-11-07?04:19??tutors\data\dolphins.mtl
?????文件???????50315??2005-11-07?04:19??tutors\data\dolphins.obj
?????文件?????????536??2005-11-07?04:19??tutors\data\f-16.mtl
?????文件??????284767??2005-11-07?04:19??tutors\data\f-16.obj
?????文件???????49183??2005-11-07?04:19??tutors\data\fishermen.ppm
............此處省略30個文件信息

評論

共有 條評論