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

資源簡介

利用OpenGL實現了三維點云的顯示,添加了鼠標控制事件,可以用鼠標對三維點云模型進行移動、縮放等功能。很不錯的源代碼,本代碼運行環境是VS2010,需要添加OpenGL的配置。很不錯的源代碼分享給大家。

資源截圖

代碼片段和文件信息

//?999.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?
#include??????/*?For?“exit“?prototype?*/
#include?????/*?Header?File?For?The?GLUT?Library?*/

/*?ASCII?code?for?the?escape?key.?*/
#define?ESCAPE?27

GLint?window;???????????/*?The?number?of?our?GLUT?window?*/
GLint?Xsize=480;
GLint?Ysize=640;

GLfloat?xs=1.0ys=1.0zs=1.0;???/*?scale?*/
GLfloat?xr=0.0yr=0.0zr=0.0;
bool?mouseLeftDown?=?false;
bool?mouseRightDown?=?false;
float?mouseX?=?0?mouseY?=?0;
float?cameraDistance?=?-3.0;
float?cameraAngleX?=?0;
float?cameraAngleY?=?0;

/*?Simple?window?transformation?routine?*/
GLvoid?Transform(GLfloat?Width?GLfloat?Height)
{
??glViewport(0?0?Width?Height);??????????????/*?Set?the?viewport?*/
??glMatrixMode(GL_PROJECTION);??????????????????/*?Select?the?projection?matrix?*/
??glLoadIdentity(); /*?Reset?The?Projection?Matrix?*/
??gluPerspective(45.0Width/Height0.1100.0);??/*?Calculate?The?Aspect?Ratio?Of?The?Window?*/
??glMatrixMode(GL_MODELVIEW);???????????????????/*?Switch?back?to?the?modelview?matrix?*/
}


/*?A?general?OpenGL?initialization?function.??Sets?all?of?the?initial?parameters.?*/
GLvoid?InitGL(GLfloat?Width?GLfloat?Height)
{
??glClearColor(0.0?0.0?0.0?0.0); /*?This?Will?Clear?The?Background?Color?To?Black?*/
??glShadeModel(GL_SMOOTH);
??Transform(?Width?Height?);???????????????????/*?Perform?the?transformation?*/
}

/*?The?function?called?when?our?window?is?resized??*/
GLvoid?ReSizeGLScene(GLint?Width?GLint?Height)
{
??if?(Height==0)????Height=1;???????????????????/*?Sanity?checks?*/
??if?(Width==0)?????Width=1;
??Transform(?Width?Height?);???????????????????/*?Perform?the?transformation?*/
}


/*?The?main?drawing?function

???In?here?we?put?all?the?OpenGL?and?calls?to?routines?which?manipulate
???the?OpenGL?state?and?environment.

???This?is?the?function?which?will?be?called?when?a?“redisplay“?is?requested.
*/

GLvoid?DrawGLScene()
{
??glClear(GL_COLOR_BUFFER_BIT?|?GL_DEPTH_BUFFER_BIT); /*?Clear?The?Screen?And?The?Depth?Buffer?*/

??glPushMatrix();?//把矩陣壓入棧中保存起來,留著以后再用

??glLoadIdentity();?//把矩陣堆棧中的在棧頂的那個矩陣置為單位矩陣,好讓之前的任何變換都不影響后面的變化
?//?glTranslatef(0.00.00.0);?//下面物體將在(x0.0f0.0f)的位置繪制
?//?glRotatef(xr1.00.00.0);?//沿x0.0f0.0f的y軸旋轉45度????從?坐標(0,0,0)即原點,引出一條線到(100)用右手握住這條線,
//這時,你會問,如何握?右手大拇指指向?(0,0,0)至(1,0,0)的方向?才握。另外四個手指的彎曲指向?即是物體旋轉方向。
??glTranslatef(0?0?cameraDistance);
??glRotatef(cameraAngleX?1?0?0);
??glRotatef(cameraAngleY?0?1?0);
??glScalef(xsyszs);??????//xsyszs分別為模型在xyz軸方向的縮放比。???

?//?glBegin(GL_QUADS);??????????
?glBegin(GL_POLYGON);?
????glColor3f(1.01.00.0);?????
????glVertex3f(?1.0?1.0?1.0);???????
????glColor3f(1.00.00.0);?????
????glVertex3f(-1.0?1.0?1.0);????????
????glColor3f(1.01.00.0);?????
????glVertex3f(-1.0-1.0?1.0);???????
glColor3f(1.00.00.0);?????
glVertex3f(?1.0-1.0?1.0);?
??glEnd();


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-05-20?19:29??OpenGL?3D顯示\
?????目錄???????????0??2016-05-20?19:28??OpenGL?3D顯示\999\
?????文件????25317376??2016-05-03?12:12??OpenGL?3D顯示\999.sdf
?????文件?????????876??2016-04-20?09:27??OpenGL?3D顯示\999.sln
?????文件???????12288??2016-05-03?12:12??OpenGL?3D顯示\999.suo
?????文件????????6493??2016-05-03?09:17??OpenGL?3D顯示\999\999.cpp
?????文件????????4360??2016-04-20?09:27??OpenGL?3D顯示\999\999.vcxproj
?????文件????????1327??2016-04-20?09:27??OpenGL?3D顯示\999\999.vcxproj.filters
?????文件?????????143??2016-04-20?09:27??OpenGL?3D顯示\999\999.vcxproj.user
?????目錄???????????0??2016-05-20?19:27??OpenGL?3D顯示\999\Debug\
?????文件?????????406??2016-04-20?09:35??OpenGL?3D顯示\999\Debug\999.exe.embed.manifest
?????文件?????????472??2016-04-20?09:35??OpenGL?3D顯示\999\Debug\999.exe.embed.manifest.res
?????文件?????????381??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\999.exe.intermediate.manifest
?????文件??????????47??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\999.lastbuildstate
?????文件????????2509??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\999.log
?????文件???????17308??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\999.obj
?????文件?????1179648??2016-04-20?09:35??OpenGL?3D顯示\999\Debug\999.pch
?????文件???????????0??2016-04-20?09:35??OpenGL?3D顯示\999\Debug\999.write.1.tlog
?????文件?????????196??2016-04-20?09:35??OpenGL?3D顯示\999\Debug\999_manifest.rc
?????文件????????1754??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\cl.command.1.tlog
?????文件????????3288??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\CL.read.1.tlog
?????文件?????????548??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\CL.write.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link-cvtres.read.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link-cvtres.write.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.8880-cvtres.read.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.8880-cvtres.write.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.8880.read.1.tlog
?????文件???????????2??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.8880.write.1.tlog
?????文件????????2228??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.command.1.tlog
?????文件????????5624??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.read.1.tlog
?????文件?????????610??2016-04-20?11:11??OpenGL?3D顯示\999\Debug\link.write.1.tlog
............此處省略52個文件信息

評論

共有 條評論