资源简介
初步了解OpenGL 程序设计结构,了解OpenGL 的基本数据类型、核心函数
及辅助函数的使用。
本实验主要目的:
1. 掌握OpenGL 相关的基本概念。
2. 掌握OpenGL 的工作机理及基本程序结构。
3. 掌握OpenGL 基本几何元素的绘制。
(1)输入五角星中心坐标(xc,yc)、外圆半径r,内圆半径r1,如图1.21 所示。
输入以上参数绘制五角星。
(2)*通过程序连续变化内圆半径绘制五角星,观察五角星形状变化。

代码片段和文件信息
// MainFrm.cpp : implementation of the CMainframe class
//
#include “stdafx.h“
#include “sy1.h“
#include “MainFrm.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainframe
IMPLEMENT_DYNCREATE(CMainframe CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR // status line indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
// CMainframe construction/destruction
CMainframe::CMainframe()
{
// TODO: add member initialization code here
}
CMainframe::~CMainframe()
{
}
int CMainframe::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CframeWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this TBstyle_FLAT WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINframe))
{
TRACE0(“Failed to create toolbar\n“);
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators
sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed to create status bar\n“);
return -1; // fail to create
}
// TODO: Delete these three lines if you don‘t want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainframe::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CframeWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainframe diagnostics
#ifdef _DEBUG
void CMainframe::AssertValid() const
{
CframeWnd::AssertValid();
}
void CMainframe::Dump(CDumpContext& dc) const
{
CframeWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainframe message handlers
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19649 2012-03-10 11:49 实验一\Debug\MainFrm.obj
文件 105388 2012-03-10 11:49 实验一\Debug\StdAfx.obj
文件 122922 2012-03-16 12:46 实验一\Debug\sy1.exe
文件 386860 2012-03-16 12:46 实验一\Debug\sy1.ilk
文件 22763 2012-03-10 11:49 实验一\Debug\sy1.obj
文件 5503668 2012-03-10 11:49 实验一\Debug\sy1.pch
文件 443392 2012-03-16 12:46 实验一\Debug\sy1.pdb
文件 7196 2012-03-10 11:49 实验一\Debug\sy1.res
文件 14304 2012-03-10 11:49 实验一\Debug\sy1Doc.obj
文件 32428 2012-03-16 12:46 实验一\Debug\sy1View.obj
文件 214016 2012-03-16 12:46 实验一\Debug\vc60.idb
文件 364544 2012-03-16 12:46 实验一\Debug\vc60.pdb
文件 2504 2012-03-10 11:16 实验一\MainFrm.cpp
文件 1581 2012-03-10 11:16 实验一\MainFrm.h
文件 4239 2012-03-10 11:16 实验一\ReadMe.txt
文件 1078 2012-03-10 11:16 实验一\res\sy1.ico
文件 395 2012-03-10 11:16 实验一\res\sy1.rc2
文件 1078 2012-03-10 11:16 实验一\res\sy1Doc.ico
文件 1078 2012-03-10 11:16 实验一\res\Toolbar.bmp
文件 488 2012-03-10 11:16 实验一\Resource.h
文件 205 2012-03-10 11:16 实验一\StdAfx.cpp
文件 1054 2012-03-10 11:16 实验一\StdAfx.h
文件 28296 2012-03-10 11:18 实验一\sy1.aps
文件 2223 2012-03-10 11:18 实验一\sy1.clw
文件 4155 2012-03-10 11:16 实验一\sy1.cpp
文件 4553 2012-03-10 12:28 实验一\sy1.dsp
文件 514 2012-03-10 12:28 实验一\sy1.dsw
文件 1323 2012-03-10 11:16 实验一\sy1.h
文件 58368 2012-03-16 12:47 实验一\sy1.ncb
文件 48640 2012-03-10 19:17 实验一\sy1.opt
............此处省略13个文件信息
相关资源
- 计算机图形学 边填充算法实现代码
- OpenGL参考手册
- 计算机图形学课设 画板
- Qt Creator opengl实现四元数鼠标控制轨迹
- OpenGL文档,api大全,可直接查询函数
- opengl轮廓字体源代码
- MFC读三维模型obj文件
- 利用OpenGL写毛笔字算法
- MFC中OpenGL面和体的绘制以及动画效果
- 基于OPENGL的光线跟踪源代码368758
- VC 实现三维旋转(源码)
- 简易绘图程序(计算机图形学课程设
- 自编用openGL实现3D分形树,分形山
- OpenGL球形贴图自旋程序
- OpenGL导入贴图的Texture类
- 计算机图形学(openGL)代码
- 图形学集成程序dda、中点算法、多边
- 计算机图形实验(哈尔滨工程大学)
- 用OpenGL开发的机械臂运动仿真程序(
- OpenGL-3D坦克模拟
- OPENGL实现世界上最小的3D游戏
- VS2012OpenGL配置所需要的全部libdllh文件
- 基于OpenGL的仿蝗虫机器人三维动态仿
- 计算机图形学-全.rar
- 图形学 - OpenGL实现3种三维茶壶显示源
- opengl程序-会跳舞的骷髅
- opengl实现三维网格光顺Laplacian算法
- opengl——爆炸
- OpenGL三维地形建模
- opengl游戏编程徐明亮版(含源码)
评论
共有 条评论