- 2
- 0
- 约2.17千字
- 约 30页
- 2017-08-12 发布于河南
- 举报
Geometric Objects and Transformations(I)课件
Geometric Objects and Transformations (I) ;;Outline;3D Primitives;Complexity and Efficiency;Three Features;Coordinate System;Frames;Changes of Coordinate Systems;Transformation for Vectors;Homogeneous Coordinates;Transformation for Frames;Homogeneous Coordinates;Working with Representations;Find the Transformation Matrix;Hence, we have;Frames in OpenGL;Camera Frame;Example: moving the camera;Example: camera in the world frame;Modeling a Colored Cube;Modeling of a Cube;Inward and Outward Faces;Vertices of the cube in cube.c:
GLfloat vertices[][3]
Facets of the cube in cube.c:
void polygon (int a, int b, int c , int d)
The cube in cube.c:
void colorcube(void);The Color Cube;Bilinear Interpolation;Vertex Arrays;OpenGL allows 6 different types of arrays
Vertex, color, color index, normal, texture coordinate and edge flag.
Corresponding to 6 items that can be set between a glBegin and glEnd.
For the color cube, we only need colors and vertices.
We enable the corresponding arrays by
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
The arrays are the same as before: cubev.c;We tell OpenGL where the arrays is
glVertexPointer(3, GL_FLOAT, 0, vertices);
glColorPointer(3,GL_FLOAT, 0, colors);
The 1st 3 arguments state that the elements are 3D vertices and colors stored as floats and that the elements are contiguous (byte offset = 0).
Now we have to provide the information in our data structure about the relationship between the vertices and faces of the cube.
This is done by specifying an array that holds the 24 ordered vertex indices for the 6 faces
GLubyte cubeIndices[] in cubev.c;We use the following function to render the cube:
void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
mode: the type of the element, e.g., line or polygon, ….
count: the number of elements to draw
type : the data type in the index arrays
index: the first index to use
One way to render the cube is
for (i = 0; i 6; i++)
glDrawElements
您可能关注的文档
- 在职教育硕士名词解释重点准备.doc
- 第八章 3全微分.ppt
- 鸟巢结构分析课件.ppt
- F3782公司税法ppt课件.ppt
- 设备URS编制与验证课件.ppt
- 设备故障与处理情况分析总结报告课件.ppt
- 设备选择与更新课件.ppt
- 设计技术交底与图纸会审纪要课件.ppt
- 设计基本原则课件.ppt
- F5负载设备均衡部署方案课件.ppt
- 广东省广州省实验中学教育集团2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州大学附属中学2025-2026学年八年级上学期奥班期中物理试题(解析版).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(含答案).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第八十六中学2025-2026学年八年级上学期期中物理试题(解析版).docx
- 广东省广州市第八十九中学2025-2026学年八年级上学期期中考试物理试题(含答案).docx
- 广东省广州市第二中学2025-2026学年八年级上学期期中考试物理试题(解析版).docx
- 2026《中国人寿上海分公司营销员培训体系优化研究》18000字.docx
- 《生物探究性实验教学》中小学教师资格模拟试题.docx
最近下载
- 2025年德州市中考数学试题卷(含答案及解析).docx
- ISO 15614-1-2012 金属材料焊接工艺规范和评定.pdf VIP
- 发那科fanuc维修手册 内部资料教材.pdf VIP
- 2026年节后复工开工第一课课件.ppt
- 蔬菜水果的收货验货标准.doc VIP
- 新部编人教版语文五年级上册生字字帖直接打印资料文档.pdf VIP
- 东北大学2024-2025学年第1学期《高等数学(上)》期末考试试卷(A卷)附参考答案.pdf
- T_DZJN 455-2025 冶金工业变频节能选型设计规范.docx VIP
- 北京邮电大学《机器学习》2024 - 2025 学年第一学期期末试卷.pdf VIP
- 新版2026春重庆大学版英语四年级下册单词表国标手写斜体描红字帖.pdf
原创力文档

文档评论(0)