1、本文所以內容來自 著名高校課件和學生筆記(校園裡面經常見到有人高價買筆記)
2、任課教師不會提供參考文獻,所以只能對作者表示感謝,如果引用了您的作品,可以用回
複方式補充參考文獻。
3、我不對文章無關問題進行解答,文章內容也比較難,我也很難解答您遇到的問題,如果發
現BUG可以用回複方式幫我修正。
4、本課 屬於Computer Graphics
,適用於電腦圖形學課程,教材為電子工業出版
社Computer Graphics(電腦圖形學,中文版和英文版)
本課其他部分的導航條見頁面底部
Overview of Graphics System
§2.1 Video Display Devices
The primary output device is a video monitor.
Stereoscopic(立體的) and Virtual-Reality Systems
Display stereoscopic(立體的) views of objects.
This method does not produce true 3-D images, but provide a 3-D effect by presenting a different view to each eye of an viewer.
§2.2 Raster-Scan Systems (光柵掃描系統)
Interactive raster-graphics systems typically employ several processing units.
§2.7 Graphics Software
There are two broad classifications for computer-graphics software:
Special-purpose packages
General programming packages
General Programming Packages
A general programming package provides a library of graphics functions that can be used in C, C++, Java etc.
Such as GL (Graphics Library), OpenGL, VRML (Virtual-Reality Modeling Language), Java 2D, Java 3D.
A set of graphics functions is often called computer-graphics application programming interface (CG API).
Graphics Functions
The basic building blocks for pictures are referred to as graphics output primitives.
Attributes are properties of the output primitives.
We can change the size, position, orientation of the object using geometric transformations.
Viewing transformations are used to select a view of scene.
Input functions are used to control and process the data flow from the interactive devices.
OpenGL Language Binding
Graphics functions in any package are typically defined as a set of specifications that are independent of any programming language.
A language binding is then defined for a particularly high-level programming language.
This binding gives the syntax for accessing the various graphics functions.
Basic OpenGL Syntax
Function names in the OpenGL basic (core) library are prefixed with gl, such as:
glBegin, glClear, glCopyPixels
Certain function require one (or more) of their arguments be assigned a symbolic constant, such as:
GL_2D, GL_RGB, GL_POLYGON
The OpenGL functions also expect specific data types:
GLbyte, GLshort, GLint, GLfloat, GLdouble, GLboolean
Header Files
To use the OpenGL ibraries, we should:
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <GL/glaux.h>
#include <GL/gl.h> #include <GL/glaux.h>
void main(void) { auxInitDisplayMode(AUX_SINGLE|AUX_RGBA); auxInitPosition(0,0,500,500); auxInitWindow(“simple”); glClearColor(0.0,0.0,0.0,0.0); glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0); glRectf(-0.5,-0.5,0.5,0.5);
glFlush(); _sleep(1000); }