《计算机图形学》课程教学资源(PPT课件讲稿)Chapter 5 Attributes of Graphics Primitives

COIS712/ECOM708/C0IS800 Computer Graphics-Principles Systems Advanced Computer Graphics and Multimedia Advanced Computer Graphics& virtual Simulation Chapter 5 Attributes of Graphics Primitives
COIS712/ECOM708/COIS800 Computer Graphics – Principles & Systems Advanced Computer Graphics and Multimedia Advanced Computer Graphics & Virtual Simulation Chapter 5 Attributes of Graphics Primitives

Chapter 5 Attributes of Graphics Primitives Part I Color, point and line attributes Open gl functions
Chapter 5. Attributes of Graphics Primitives Part I. Color, point and line attributes OpenGL functions 2

Outline pen gL State Machine and variables Color and gray scale Open gl Color Functions Opengl point-Attribute Functions o Open gl Line-Attribute Functions
Outline OpenGL State Machine andVariables Color and Gray Scale OpenGL Color Functions OpenGL Point-AttributeFunctions OpenGL Line-Attribute Functions 3

OpenGL State Machine State system(or state machine) o a graphics system that maintains a list for the current values of attributes and other parameters(state variables or state parameters) We assign a value to one or more state parameters, that is, we put the system into a certain state o The state will be persistent until we change the value of a state arameter to change to change State 3 State 1 State 2 to change
OpenGL State Machine 4 State 1 …… State 2 to change State system (or state machine) A graphics system that maintains a list for the current values of attributes and other parameters (state variables or state parameters). We assign a value to one or more state parameters, that is, we put the system into a certain state. The state will be persistent until we change the value of a state parameter. to change to change State 3

OpenGL State Machine o Open gL is a finite state machine predetermined and countable number of different states e The graphics system behaviors are determined by these system state, which can be modified by calling openGL functions The Open gl state includes e The current color or other attributes MatrixMode(GL PROJECTION) o The current model viewing transformations g denty( ) gluortho2D(…) The current camera model clipping e The current lighting reflectance mo ● The current viewport All have default values, remaining until a new setting on it
OpenGL State Machine OpenGL is a finite state machine A predetermined and countable number of different states The graphics system behaviors are determined by these system state, which can be modified by calling OpenGL functions. The OpenGL state includes: The current color or other attributes The current model & viewing transformations The current camera model & clipping The current lighting & reflectance model The current viewport All have default values, remaining until a new setting on it. … glMatrixMode (GL_PROJECTION); glLoadIdentity( ); gluOrtho2D( … ); … 5

OpenGL State Machine A common misconception imitive drawing functions are state changes o They are the output functions telling the system to draw something to the screen with the certain specified current state The options of the current state the current color gcor3f00.0.0.0.0); the current point size glPointSize(1.5) the depth function-enabled or not
OpenGL State Machine A common misconception The primitive drawing functions are state changes They are the output functions telling the system to draw something to the screen with the certain specified currentstate. The options of the current state the currentcolor the current point size the depth function - enabled or not … glColor3f(0.0, 0.0, 0.0); glPointSize(1.5); 6

OpenGL State Machine e what do you do to maintain states and state variables b Opengl? To set states for drawing geometric primitives E. g: glPoint Size(size ) glLine Stipple(repeat, pattern g Shade Model(GL_SMOOtH) o or change(enable) states of how Open gl draws them o by default, most of these states are initially inactive Such states include: objects rendered with lighting, texturing, or undergo different processes, such as hidden surface removal, fog, and other states which affect the app Dearance Toturn on/off states glEnable(GL- lighting) diSable(gl ⊥ BLEND)
OpenGL State Machine What do you do to maintain states and state variables by OpenGL? To set states for drawing geometric primitives E.g: glPointSize ( size ); glLineStipple ( repeat, pattern ); glShadeModel ( GL_ SMOOTH); or change (enable) states of how OpenGL draws them By default, most of these states are initially inactive. Such states include: objects rendered with lighting, texturing, or undergo different processes, such as hidden surface removal, fog, and other states, which affect the appearance. To turn on/off states glEnable ( GL_ LIGHTING ); glDisable ( GL_BLEND); 7

Basic State Management void glEnable glenum capability void glDisable(GLenum capability) More than 60 enumerated values can be passed as parameters to them E.g: GL BLEND (controls blending of RGBa values) GL DEPTH TEST (controls depth comparisons and updates to the depth buffer) GL FOG (controls fo GL LINE STIPPLE atterned lines) GL LIGHTING ht effect
Basic State Management E.g: GL_BLEND (controls blending of RGBA values) GL_DEPTH_TEST (controls depth comparisons and updates to the depth buffer) GL_FOG (controls fog) GL_LINE_STIPPLE (patterned lines) GL_LIGHTING (light effect) void glEnable (GLenum capability); void glDisable (GLenum capability); More than 60 enumerated values can be passed as parameters to them. 8

Basic State Management Tocheck whether a state is currently enabled or disabled GLboolean glls Enabled(GLenum capability) o Returns gl true or gL false, depending on whether or not it is currently activated e For more complicated state variables, such as glColor 3f() set three values, which are part of the gl CUrrent color state Query routines: glGet*O
Basic State Management To check whether a state is currently enabled or disabled by GLboolean glIsEnabled (GLenum capability) Returns GL_TRUE or GL_FALSE, depending on whether or not it is currently activated. For more complicated state variables, such as glColor3f ( ) set three values, which are part of the GL_CURRENT_COLOR state. Query routines: glGet* (); 9

Basic State Management o Five querying routines void glGetBooleanv( GLenumpname, GLboolean*params void glGetIntegerv(GLenum pname, GLint*params); void glgetFloatv(GLenum pname, GLfloat *params void glGetDoublev(GLenumpname, GLdouble *params void glGetPointerv(GLenum pname, GLvoid**params pname: a symbolic constant indicating the state variable to return; E. g: GL_ CURRENT_ COLOR GL CURRENT NORMAL arms: a pointer to an array of the returned value
Basic State Management Five querying routines void glGetBooleanv (GLenum pname, GLboolean *params); void glGetIntegerv (GLenum pname, GLint *params); void glGetFloatv (GLenum pname, GLfloat *params); void glGetDoublev (GLenum pname, GLdouble *params); void glGetPointerv (GLenum pname, GLvoid **params); pname: a symbolic constant indicating the state variable to return; E.g.: GL_CURRENT_COLOR, GL_CURRENT_NORMAL params: a pointer to an array of the returned value. 10
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《计算机原理及应用》课程教学资源(PPT课件讲稿)第9章 单片机I/O接口扩展技术.pptx
- 《Access 2013数据库技术及应用》课程教学资源(PPT课件讲稿)第12章 VBA模块设计.ppt
- 清华大学:智能弹性重叠网关键技术研究(PPT讲稿,指导老师:李衍达).ppt
- 中国科学技术大学:《数据结构及其算法》课程PPT教学课件(Data Structure and Algorithm)第4章 栈和队列(主讲:刘东).pptx
- 北京科技大学:《物联网工程》课程教学资源(PPT课件讲稿)课程介绍.ppt
- 《电脑组装与维护实例教程》教学资源(PPT课件讲稿)第4章 输入输出设备介绍及选购.ppt
- 深圳大学:Learning 3D mesh segmentation and labeling(PPT讲稿).ppt
- 沈阳理工大学:《大学计算机基础》课程教学资源(PPT课件讲稿)第3章 办公软件 3.2 电子表格软件Excel 2010.ppt
- 对外经济贸易大学:《电子商务概论》期末考试试卷(部分含答案).pptx
- 清华大学:Pass-Join(A Partition based Method for Similarity Joins).pptx
- 《信息安全概论》课程教学资源(PPT课件讲稿)第九章 计算机软件的安全性.ppt
- 合肥工业大学:《数据库系统》课程教学资源(PPT课件讲稿)数据库编程 ACCESS、MYSQL、Oracle(张国富)第一章 绪论.ppt
- 白城师范学院:《数据库系统概论 An Introduction to Database System》课程教学资源(PPT课件讲稿)第四章 数据库安全性.pptx
- 清华大学:A Heterogeneous Accelerator Platform for Multi-subject Voxel-based Brain Network Analysis(PPT讲稿).pptx
- 南京理工大学:《数据挖掘与处理 Data Mining and Data Processing》课程教学资源(PPT课件讲稿)第一章 数据科学与数据挖掘(张正军).ppt
- 香港浸会大学:《Data Communications and Networking》课程教学资源(PPT讲稿)Chapter 2 Protocol Architecture - TCP/IP model and OSI Model.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第十章 文件、外部排序与外部搜索.ppt
- 《网站开发》课程教学资源(PPT课件讲稿)网站开发各阶段的任务.ppt
- 《C++大学教程》课程教学资源(PPT课件讲稿)Chapter 17 文件处理 File Processing.ppt
- 清华大学出版社:普通高校本科计算机专业特色教材精选《智能技术》课程教学资源(PPT讲稿课件)第4章 模糊逻辑技术(曹承志).ppt
- 《计算机操作系统》课程教学资源(PPT讲稿)Windows 2003的安全.ppt
- 厦门大学计算机科学系:《大数据技术原理与应用》课程教学资源(PPT课件)第12章 数据可视化.ppt
- 西安电子科技大学:《微机原理与接口技术》课程教学资源(PPT课件讲稿)第四章 汇编语言程序设计(主讲:王晓甜).pptx
- 计算机维护与维修(PPT课件讲稿)第十二章 笔记本电脑维护维修.ppt
- 《C语言程序设计》课程电子教案(PPT教学课件)第三章 分支结构.ppt
- 电子科技大学:《面向对象程序设计语言C++》课程教学资源(PPT课件讲稿)第五章 构造数据类型.ppt
- 武汉科技大学中南分校:Windows 2000/XP网络组建与系统管理(系统安装,李燕).ppt
- 《The C++ Programming Language》课程教学资源(PPT课件讲稿)Lecture 06 OOP with Templates.ppt
- 厦门大学:《分布式数据库》课程教学资源(PPT课件讲稿)专题一 分布式数据库介绍.ppt
- 中国科学技术大学:《计算机体系结构》课程教学资源(PPT课件讲稿)第6章 Data-Level Parallelism in Vector, SIMD, and GPU Architectures.pptx
- 清华大学:无线网和移动网(PPT课件讲稿)Mobile and wireless network.pptx
- 广西医科大学:《计算机网络 Computer Networking》课程教学资源(PPT课件讲稿)Chapter 02 Network Classification.pptx
- 《电脑组装与维护实例教程》教学资源(PPT课件讲稿)第5章 多媒体设备介绍及选购.ppt
- 《网络算法学》课程教学资源(PPT课件讲稿)第三章 实现原则.ppt
- 《数据结构》课程教学资源:实践教学大纲.doc
- 《数据结构》课程教学资源(PPT课件讲稿)第七章 图 Graph.ppt
- 四川大学:《操作系统 Operating System》课程教学资源(PPT课件讲稿)Chapter 3 Process Description and Control 3.4 Process Control 3.5 Execution of the Operating System 3.6 Unix SVR4 Process Management 3.7 Linux Process management system calls.ppt
- 大连理工大学:《计算机网络》课程教学资源(PPT课件讲稿)Chapter 2 应用层 application layer.ppt
- 3D Reconstruction from Images:Image-based Street-side City Modeling.ppt
- 《数据结构》课程教学资源(PPT课件讲稿)第七章 图及其应用.ppt