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

  • 大小: 2.88M
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-09-14
  • 語言: 其他
  • 標簽: 其他??

資源簡介

99273910opengl-3d-car.zip

資源截圖

代碼片段和文件信息

#include?“Bitmap24.h“
#include?“Car.h“
#include?
using?namespace?std;
Bitmap24?*pBitmap24?(0);
Car?*pCar?(0);
const?GLfloat?X?=?1690.0f;
const?GLfloat?Z?=?1280.0f;
const?GLfloat?Y?=?-31.6f;
void?Init()
{
glShadeModel(?GL_SMOOTH?);
glClearColor(?0.0?0.0?0.0?0.0);
glClearDepth(?1.0?);

GLfloat?Ambient[4]?=?{?1.0?1.0?1.0?1.0?};
GLfloat?Diffuse[4]?=?{?0.7?0.7?0.7?1.0?};
GLfloat?Position[4]?=?{?0.0?0.0?-1.0?0.0?};
GLfloat?GlobalLight[4]?=?{?0.1?0.1?0.1?1.0?};
GLfloat?shininess[]?=?{100.0f};

glLightfv(?GL_LIGHT0?GL_AMBIENT?Ambient?);
glLightfv(?GL_LIGHT0?GL_DIFFUSE?Diffuse?);
glLightfv(?GL_LIGHT0?GL_POSITION?Position?);
glLightfv(?GL_LIGHT0?GL_SHININESS?shininess?);

glLightModelfv(?GL_LIGHT_MODEL_AMBIENT?GlobalLight?);
glColorMaterial(?GL_FRONT?GL_AMBIENT_AND_DIFFUSE);
glBlendFunc(?GL_SRC_ALPHA?GL_ONE_MINUS_SRC_ALPHA?);

glEnable(?GL_LIGHTING?);
glEnable(?GL_LIGHT0?);
glEnable(?GL_COLOR_MATERIAL?);
glEnable(?GL_DEPTH_TEST?);
glEnable(?GL_CULL_FACE?);
}
void?redisplay()
{
pCar->redisplay();
glutPostRedisplay();
}
void?Display()
{
glClear(?GL_COLOR_BUFFER_BIT?|?GL_DEPTH_BUFFER_BIT?);
glPushMatrix();
gluLookAt(pCar->getDisplacementX()+600?500?pCar->getDisplacementY()-100?
pCar->getDisplacementX()?0?pCar->getDisplacementY()?
0?1.0?0);
glPushMatrix();
glEnable(GL_TEXTURE_2D);
????glTexEnvf(GL_TEXTURE_ENV?GL_TEXTURE_ENV_MODE?GL_DECAL);
????glBindTexture(GL_TEXTURE_2D??pBitmap24->getTexture());
????glBegin(GL_QUADS);
????glTexCoord2f(0.0?0.0);?glVertex3f(X?Y?-Z);
????glTexCoord2f(1.0?0.0);?glVertex3f(-X?Y?-Z);
????glTexCoord2f(1.0?1.0);?glVertex3f(-X?Y?Z);
????glTexCoord2f(0.0?1.0);?glVertex3f(X?Y?Z);
????glEnd();
????glDisable(GL_TEXTURE_2D);
glPopMatrix();
pCar->draw();
glPopMatrix();
glFlush();
glutSwapBuffers();
}

void?Reshape(?int?width?int?high?)
{
if?(?high?==?0?)high?=?1;
glViewport(?0?0?static_cast(?width?)?static_cast(?high?)?);
glMatrixMode(?GL_PROJECTION?);
glLoadIdentity();
gluPerspective(?45.0?static_cast(?width?)?/?static_cast(?high?)?0.1?10000.0?);
glMatrixMode(?GL_MODELVIEW?);
glLoadIdentity();
//gluLookAt(0?1800?-1200?0?0?0?0?1.0?0);
}

void?keyboard(const?unsigned?char?key?const?int?x?const?int?y)
{
switch(key)
{
case?‘W‘:case?‘w‘:
pCar->accelerate(0.1f);
break;
case?‘S‘:case?‘s‘:
pCar->decelerate(0.1f);
break;
case?‘D‘:case?‘d‘:
pCar->turnRight(30.0f);
break;
case?‘A‘:case?‘a‘:
pCar->turnLeft(30.0f);
break;
case?‘?‘:
pCar->brake();
break;
default:
return;
}
glutPostRedisplay();
}
int?main(?int?argc?char*?argv[]?)
try
{
pCar?=?new?Car(“Car.3DS“);
pBitmap24?=?new?Bitmap24(“paodao1.bmp“);
glutInit(?&argc?argv?);
glutInitDisplayMode(?GLUT_DOUBLE?|?GLUT_RGBA?|?GLUT_DEPTH?);
glutInitWindowSize(?800?600?);
glutInitWindowPosition(?10

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-07-17?12:44??opengl-3d?car\
?????目錄???????????0??2012-07-17?12:44??opengl-3d?car\JustDoIt1\
?????目錄???????????0??2012-07-17?12:45??opengl-3d?car\JustDoIt1\JustDoIt\
?????文件?????????864??2009-08-02?11:42??opengl-3d?car\JustDoIt1\JustDoIt\3dsId.h
?????文件????????1890??2009-08-04?17:30??opengl-3d?car\JustDoIt1\JustDoIt\Bitmap1.h
?????文件????????2038??2009-08-04?17:37??opengl-3d?car\JustDoIt1\JustDoIt\Bitmap24.h
?????文件?????1394703??2009-07-30?20:03??opengl-3d?car\JustDoIt1\JustDoIt\Car.3DS
?????文件????????4026??2009-08-16?19:55??opengl-3d?car\JustDoIt1\JustDoIt\Car.h
?????目錄???????????0??2012-07-17?12:44??opengl-3d?car\JustDoIt1\JustDoIt\Debug\
?????文件????????5408??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\Debug\BuildLog.htm
?????文件?????1394703??2009-07-30?20:03??opengl-3d?car\JustDoIt1\JustDoIt\Debug\Car.3DS
?????文件?????????145??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\Debug\JustDoIt.exe.intermediate.manifest
?????文件??????289973??2009-08-03?21:23??opengl-3d?car\JustDoIt1\JustDoIt\Debug\MyLoader.obj
?????文件??????268682??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\Debug\main.obj
?????文件??????????67??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\Debug\mt.dep
?????文件??????175104??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\Debug\vc80.idb
?????文件?????????453??2009-08-01?11:22??opengl-3d?car\JustDoIt1\JustDoIt\DrawModel.h
?????文件??????303104??2009-10-19?11:10??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.exe
?????文件???????43520??2009-07-30?17:58??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.opt
?????文件????????3528??2009-08-04?17:39??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.vcproj
?????文件????????1427??2009-08-02?15:55??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.vcproj.WWW-46D0B3DC880.Administrator.user
?????文件????????1427??2009-08-16?19:57??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.vcproj.WWW-71F7C097B45.Administrator.user
?????文件????????1427??2009-11-11?20:17??opengl-3d?car\JustDoIt1\JustDoIt\JustDoIt.vcproj.WWW-8F6AC3560E8.Administrator.user
?????文件????????9343??2009-08-03?19:21??opengl-3d?car\JustDoIt1\JustDoIt\MyLoader.cpp
?????文件????????1467??2009-08-02?11:05??opengl-3d?car\JustDoIt1\JustDoIt\MyLoader.h
?????文件?????????866??2009-08-03?19:13??opengl-3d?car\JustDoIt1\JustDoIt\MyModel.h
?????文件??????237568??2001-11-08?02:27??opengl-3d?car\JustDoIt1\JustDoIt\glut32.dll
?????文件????????3399??2009-08-16?19:57??opengl-3d?car\JustDoIt1\JustDoIt\main.cpp
?????文件???????60062??2009-08-04?17:09??opengl-3d?car\JustDoIt1\JustDoIt\paodao.bmp
?????文件?????1440054??2009-08-04?17:38??opengl-3d?car\JustDoIt1\JustDoIt\paodao1.bmp
?????文件?????1887232??2009-11-11?20:17??opengl-3d?car\JustDoIt1\JustDoIt.ncb
............此處省略8個文件信息

評論

共有 條評論