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

資源簡介

創建了一個球體類Sphere,該類借助于OpenGL來實現球體的繪制,基本思想是將球體的8分之1(第一卦限)部分的頂點生成出來,再通過7次翻轉得到其余部分的頂點,以此完成球體的繪制,算法還存在需要優化的地方,歡迎提出寶貴的意見

資源截圖

代碼片段和文件信息

//?IVTask1.cpp?:?定義控制臺應用程序的入口點。
//

#include?“stdafx.h“
#include?
#include?“glut.h“
#define?WIN_title?“信息可視化實驗1“
#define?WIN_X?50
#define?WIN_Y?50
#define?WIN_WIDTH?500
#define?WIN_HEIGHT?400
#define?ROTATE_DELTA?1.0
#define?TRANSLATE_DELTA?1.0
#define?AXIS_RENDER_LENGTH?1000.0
const?float?HALF_PI=acos(0.0);
enum?Ref_Plain?{XOYYOZXOZ};//翻轉參照面枚舉量
GLfloat?prexpreyspinx(0)spiny(0)scaleFactor=1.0;
bool?isDrag=false;
struct?Vertex
{
float?xyz;
//float?vxvyvz;
};
struct?HalfQuarterSphere
{
Vertex?topVertex;//1/8圓的穹頂點
Vertex?**?pVertexs;//其余頂點
int?numCircle;//緯線數量
int?numLine;//經線數量
float?radius;//半徑
};

HalfQuarterSphere?hqSphere;
struct?Position
{
float?xy;
};
void?printHalfQuarterSphere(const?HalfQuarterSphere&?hqSphere)
{

printf(“(%.2f?%.2f?%.2f)\n“hqSphere.topVertex.xhqSphere.topVertex.yhqSphere.topVertex.z);
for(int?i=0;i {
for(int?j=0;j {
printf(“[%d][%d]=(%.2f?%.2f?%.2f)?“ijhqSphere.pVertexs[i][j].xhqSphere.pVertexs[i][j].yhqSphere.pVertexs[i][j].z);
}
printf(“\n“);
}

}
void?flipHalfQuarterSphere(HalfQuarterSphere?&?hqSphereRef_Plain?rp)
{
switch(rp)
{
case?XOY:
hqSphere.topVertex.z=-hqSphere.topVertex.z;
for(int?i=0;i {
for(int?j=0;j {
hqSphere.pVertexs[i][j].z=-hqSphere.pVertexs[i][j].z;
}
}
break;
case?YOZ:
hqSphere.topVertex.x=-hqSphere.topVertex.x;
for(int?i=0;i {
for(int?j=0;j {
hqSphere.pVertexs[i][j].x=-hqSphere.pVertexs[i][j].x;
}
}
break;
case?XOZ:
hqSphere.topVertex.y=-hqSphere.topVertex.y;
????for(int?i=0;i {
for(int?j=0;j {
hqSphere.pVertexs[i][j].y=-hqSphere.pVertexs[i][j].y;
}
}
break;
}
}
void?generateHalfQuarterSphere(int?numCir/*緯線數*/int?numLin/*經線數*/HalfQuarterSphere&?hqSpherefloat?R)//生成第一卦限的1/8個球體
{
hqSphere.numCircle=numCir;
hqSphere.numLine=numLin;
hqSphere.radius=R;
hqSphere.topVertex.z=R;
hqSphere.topVertex.x=hqSphere.topVertex.y=0;
//hqSphere.topVertex.vx=hqSphere.topVertex.vy=0;
//hqSphere.topVertex.vz=1;
//申請內存塊
hqSphere.pVertexs=new?Vertex*[numCir];
for(int?i=0;i {
hqSphere.pVertexs[i]=new?Vertex[numLin];
}
float?cirAngleSegment=HALF_PI/numCir;//每道緯線的間距
float?cirAngleOffset=0;
float?zOffset=0;
float?angleOffset=0;
float?linAngleSegment=HALF_PI/(numLin-1);//每道相鄰經線在XOY平面投影線的夾角
//初始化緯線與XOZ平面的交點
float?curR=0;
int?boundLin=numLin-1;
????for(int?i=numCir-1;i>=0;i--)
{
zOffset=R*sin(cirAngleOffset);
//初始化當前緯線與首經線、末經線上的交點
curR=hqSphere.pVertexs[i][0].x=hqSphere.pVertexs[i][boundLin].y=sqrt(R*R-zOffset*zOffset);
hqSphere.pVertexs[i][0].y=hqSphere.pVertexs[i][boundLin].x=0;
hqSphere.pVertexs[i][0].z=hqSphere.pVertexs[i][boundLin].z=zOffset;
//hqSphere.pVertex

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????41472??2012-09-16?10:16??IVTask1\Debug\IVTask1.exe

?????文件?????494216??2012-09-16?10:16??IVTask1\Debug\IVTask1.ilk

?????文件?????535552??2012-09-16?10:16??IVTask1\Debug\IVTask1.pdb

?????文件????2359296??2012-09-16?10:36??IVTask1\ipch\ivtask1-c161c19e\ivtask1-b9462aaf.ipch

?????文件???????1754??2012-09-16?10:16??IVTask1\IVTask1\Debug\cl.command.1.tlog

?????文件???????4294??2012-09-16?10:16??IVTask1\IVTask1\Debug\CL.read.1.tlog

?????文件???????1314??2012-09-16?10:16??IVTask1\IVTask1\Debug\CL.write.1.tlog

?????文件????????406??2012-09-13?20:48??IVTask1\IVTask1\Debug\IVTask1.exe.embed.manifest

?????文件????????472??2012-09-13?20:48??IVTask1\IVTask1\Debug\IVTask1.exe.embed.manifest.res

?????文件????????381??2012-09-16?10:16??IVTask1\IVTask1\Debug\IVTask1.exe.intermediate.manifest

?????文件????????102??2012-09-16?10:16??IVTask1\IVTask1\Debug\IVTask1.lastbuildstate

?????文件???????2437??2012-09-16?10:16??IVTask1\IVTask1\Debug\IVTask1.log

?????文件??????32080??2012-09-16?10:16??IVTask1\IVTask1\Debug\IVTask1.obj

?????文件????1179648??2012-09-13?20:48??IVTask1\IVTask1\Debug\IVTask1.pch

?????文件????????204??2012-09-13?20:48??IVTask1\IVTask1\Debug\IVTask1_manifest.rc

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link-cvtres.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link-cvtres.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.2428-cvtres.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.2428-cvtres.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.2428.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.2428.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.3508-cvtres.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.3508-cvtres.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.3508.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.3508.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.4500-cvtres.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.4500-cvtres.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.4500.read.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.4500.write.1.tlog

?????文件??????????2??2012-09-16?10:16??IVTask1\IVTask1\Debug\link.4820-cvtres.read.1.tlog

............此處省略55個文件信息

評論

共有 條評論