• 大小: 3.93MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-15
  • 语言: 其他
  • 标签: 图形学  三维变换  

资源简介

计算机图形学的大作业其中一部分,三维鼠标交互式变换,实现消隐、立体建模和光照面着色等,效果不错,大家相互学习下。

资源截图

代码片段和文件信息

#include “StdAfx.h“
#include “Cone.h“
#include “Matrix.h“

CCone::CCone(double height double radius int r int g int b)
: m_Height(height)  m_Radius(radius)
{
sRender.Init(rgb);
VERTEX3 v;
for(int i = 0; i < CONE_VERTEX_NUM; i++)
{
double alpha = (2 * i * PI) / (double)CONE_VERTEX_NUM;
v.z = m_Radius * cos(alpha);
v.x = m_Radius * sin(alpha);
v.y = 0.0;
m_Vertex3.push_back(v);
}
v.z = v.x = 0.0; v.y = m_Height; m_Vertex3.push_back(v);
v.z = v.x = v.y = 0.0; m_Vertex3.push_back(v);
CShapeFace f1;//底面
f1._pShape = this;
for(int j = CONE_VERTEX_NUM - 1; j >= 0; j--)
{
f1._facepoints.push_back(j);
CShapeFace f;
f._pShape = this;
f._facepoints.push_back(CONE_VERTEX_NUM);//圆锥顶点
f._facepoints.push_back(j);
if(j == CONE_VERTEX_NUM - 1)
f._facepoints.push_back(0);
else
f._facepoints.push_back(j + 1);
m_faces.push_back(f);
}
m_faces.push_back(f1);
_VertexNormal.resize(m_Vertex3.size());
Redraw(true);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1005  2009-12-28 14:42  graph(Part3)\Cone.cpp

     文件        379  2009-12-28 14:42  graph(Part3)\Cone.h

     文件       1473  2009-12-28 14:42  graph(Part3)\ConeDlg.cpp

     文件       1261  2009-12-28 14:42  graph(Part3)\ConeDlg.h

     文件       1738  2009-12-28 14:42  graph(Part3)\Cube.cpp

     文件        244  2009-12-28 14:42  graph(Part3)\Cube.h

     文件       1177  2009-12-28 14:42  graph(Part3)\CubeDlg.cpp

     文件       1246  2009-12-28 14:42  graph(Part3)\CubeDlg.h

     文件       1420  2009-12-28 14:42  graph(Part3)\Cylinder.cpp

     文件        408  2009-12-28 14:42  graph(Part3)\Cylinder.h

     文件       1328  2009-12-28 14:42  graph(Part3)\CylinderDlg.cpp

     文件       1308  2009-12-28 14:42  graph(Part3)\CylinderDlg.h

     文件      83716  2010-01-03 15:09  graph(Part3)\Debug\Cone.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\Cone.sbr

     文件      10547  2010-01-03 15:09  graph(Part3)\Debug\ConeDlg.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\ConeDlg.sbr

     文件      85897  2010-01-03 15:09  graph(Part3)\Debug\Cube.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\Cube.sbr

     文件      10455  2010-01-03 15:09  graph(Part3)\Debug\CubeDlg.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\CubeDlg.sbr

     文件      85116  2010-01-03 15:09  graph(Part3)\Debug\Cylinder.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\Cylinder.sbr

     文件      10665  2010-01-03 15:09  graph(Part3)\Debug\CylinderDlg.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\CylinderDlg.sbr

     文件       3269  2010-01-03 15:09  graph(Part3)\Debug\frameBox.obj

     文件          0  2010-01-03 15:09  graph(Part3)\Debug\frameBox.sbr

     文件    3384320  2010-01-03 15:09  graph(Part3)\Debug\graph.bsc

     文件     196664  2010-01-03 15:09  graph(Part3)\Debug\graph.exe

     文件     491916  2010-01-03 15:09  graph(Part3)\Debug\graph.ilk

     文件      29632  2010-01-03 15:09  graph(Part3)\Debug\graph.obj

............此处省略83个文件信息

评论

共有 条评论