版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Computer
GraphicsChen
xue
gongTeaching
Material
and
References
1.Donald
Hearn,M.Pauline
Baker,Computer
Graphics
with
OpenGL,ThirdEdition,电子工业出版社,2004.
2.Dave
Shreiner,Mason
Woo,OpenGL编程指南(OpenGL
Programming
Guide,Fifth
Edition),机械工业出版社,2006.Section1.Building
OpenGLApplication
1.Copy
GLUT.dll
and
GLUT32.dll
to
folderSysten322.Copy
GLUT32.lib
to
vc
lib
folder3.Copy
glut.h
to
vc
include
folder4.New
a
console
project5.Edit
or
import
OpenGL
codepile
and
run
applicationSection1.Building
OpenGLApplication7.Example(1)colormat.c(2)material.c(3)pointp.c(4)line.cSection2.
Graphics
Output(1)1.Coordinate
system(1)Screen
coordinates(2)World
coordinates(Cartesian
coordinat2.OpenGL
projections3.OpenGL
point
functions4.OpenGL
line
functions5.Line-drawing
algorithmsSection2.
Graphics
Output(1)DDA(digital
differential
analyzer)
algorithmSection2.
Graphics
Output(1)Bresenham’s
line
algorithmSection2.
Graphics
Output(1)Bresenham’s
line
algorithm–
d1=
dx(2y1-2y0-1)=2dy-dx;–if(di>=0){– yi=yi-1+1;– di+1=di+2(dy-dx);–
}else
{yi=yi-1
;di+1=di+2dy;–
}Section3.
Graphics
Output(2)1.
PolygonConvex(凸)
polygon: all
interior
angles
of
apolygon
are
less
than
or
equal
to
180°.Concave(凹)polygon:
a
polygon
is
not
convex.Degenerate(退化)polygon:
a
set
of
verticesthat
are
collinear
or
at
the
same
position.In
OpenGL,
a
fill
area
must
be
specified
asa
convex
polygon.Section3.
Graphics
Output(2)2.OpenGL
polygon
fill-area
functions–
glRect*(x1,
y1,
x2,
y2);glBegin(GL_POLYGON);glBegin(GL_TRIANGLES);glBegin(GL_TRIANGLE_STRIP);glBegin(GL_TRIANGLE_FAN);glBegin(GL_QUADS);glBegin(GL_QUAD_STRIP);examples:
polys.cSection3.
Graphics
Output(2)3.OpenGL
bitmap
and
image
functionsglBitmap(width,
height,
x0,
y0,
dx,
dy,
bitmaglRasterPos*();glDrawPixel(width,
height,
dataFormat,dataType,
pixmap);Section3.
Graphics
Output(2)4.OpenGL
display
lists(显示列表)glGenLists(number);glNewList(listID,
listMode);glCalnlList(listID);example
:
font.c,
image.cSection4.
GeometricTransformations(1)1.Projectionsvoid
glOrtho(GLdouble
left,
GLdouble
right,GLdouble
bottom,
GLdouble
top,
GLdoublezNear,
GLdouble
zFar);void
glOrtho2D(GLdouble
left,
GLdouble
rightGLdouble
bottom,
GLdouble
top);Section4.
GeometricTransformations(1)nearfarview
directiontopbottomleftrightSection4.
GeometricTransformations(1)Section4.
GeometricTransformations(1)void
glFrustum(GLdouble
left,
GLdouble
rightGLdouble
bottom,
GLdouble
top,
GLdoublezNear,
GLdouble
zFar);void
glFrustum(GLdouble
left,
GLdouble
rightGLdouble
bottom,
GLdouble
top,
GLdoublezNear,
GLdouble
zFar);Section4.
GeometricTransformations(1)farleft
rightnearbottomtopview
pointSection4.
GeometricTransformations(1)Section4.
GeometricTransformations(1)2.Model-view
transformationsvoid
glRotate{f,d}(TYPE
angle,
TYPE
x,TYPE y,
TYPE
z);void
glTranslate{f,d}(TYPE x,
TYPE y,
TYPEz);void
glScale{f,d}(TYPE x,
TYPE y,
TYPE
z);3.Example
:
geometryTransform.cSection5.
GeometricTransformations(2)1.TranslationSection5.
GeometricTransformations(2)2.ScaleSection5.
GeometricTransformations(2)3.RotationSection6.Texture1、Texture
Functionsvoid
glGenTextures(GLsizei
n,GLuint
*textures);void
glTexImage2D(GLenum
target,GLint
level,GLintinternalFormat,GLsizei
width,
GLsizeiheight,GLintborder,
GLenum
format,
GLenum
type,const
GLvoid*pixels);void
glTexImage1D(GLenum
target,GLint
level,GLintinternalFormat,GLsizei
width,
GLsizeiheight,GLintborder,
GLenum
format,
GLenum
type,const
GLvoid*pixels);Section6.Texture2.Texture
Parametersvoid
glTexParameter{i,f}(GLenum
target,
GLenumpName,TYPE
param);void
glTexParameter{i,f}v(GLenum
target,
GLenumpName,TYPE
*param);functions:set
texture
parameters.
input:target
is
texture
type(GL_TEXTURE_1D,GL_TEXTURE_2D),pName
is
texture
name(GL_TEXTURE_BORDER_COLOR、
GL_TEXTURE_WRAP_S、GL_TEXTURE_WRAP_T、
GL_TEXTURE_MIN_FILTER、GL_TEXTURE_MAG_FILTER),paramif
valueof
pName.output:nothing.return:nothing.Section6.Texture3、Texture
Coordinatevoid
glTexCoord{1,2,3,4}{d,f,i,s}(TYPE
s,TYPE
t,
TYPE
r,
TYPE
q);void
glTexCoord{1,2,3,4}{d,f,i,s}v(const
TYP*v);4.Examples
:
windmill.cppSection7.
Curves
(1)1.Hermite
CurvesSection7.
Curves
(1)Section7.
Curves
Curves
(1)2.Spline
CurvesSection7.
Curves
(1)Section8.
Curves
(2)Section8.
Curves
(2)Section8.
Curves
(2)Section8.
Curves
(2)Section8.
Curves
(2)Section9.
Surfaces(1)Section9.
Surfaces(1)Section9.
Surfac
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年黑河北安市市场监督管理局通北分局面向社会公开招聘10名公益性岗位人员(公共基础知识)综合能力测试题附答案
- 2025年商丘宁陵县消防救援大队招聘政府专职消防员10名备考题库附答案
- 2025年黑河爱辉区城市、农垦社区工作者队伍“蓄水池”人员招聘12人备考题库附答案
- 2025年牡丹江恒丰纸业面向社会公开招聘70人备考题库附答案
- 2025年浙江红船干部学院、中共嘉兴市委党校公开选聘事业人员2人考试模拟卷附答案
- 2026浙江省人民医院转化医学中心招聘1人笔试备考题库及答案解析
- AI在流行病预测中的应用:技术原理与实践案例
- 2026陕西西安交通大学管理学院管理辅助工作人员招聘4人笔试备考试题及答案解析
- 2026四川九州电子科技股份有限公司招聘计划调度岗2人笔试模拟试题及答案解析
- 北京市石景山区教育系统教育人才库教师招聘笔试模拟试题及答案解析
- 房地产楼盘介绍
- 2025内蒙古润蒙能源有限公司招聘22人考试题库附答案解析(夺冠)
- 2026年国家电网招聘之电网计算机考试题库500道有答案
- (2025年)辽宁省葫芦岛市辅警招聘警务辅助人员考试题库真题试卷公安基础知识及答案
- 钢结构施工组织方案大全
- 江苏省徐州市2025-2026学年高二上学期期中考试信息技术试卷(含答案)
- 广东省广州市2025年上学期八年级数学期末考试试卷附答案
- 2025福建德化闽投抽水蓄能有限公司社会招聘4人备考题库附答案
- 2025年物业管理中心工作总结及2026年工作计划
- 雨课堂学堂在线学堂云军事理论国防大学单元测试考核答案
- 多源医疗数据融合的联邦学习策略研究
评论
0/150
提交评论