The document discusses various graphics libraries used for 3D rendering. It describes PHIGS, the first standard for 3D graphics, and its features including a scene graph and centralized structure store. OpenGL is introduced as the most widely adopted library, providing a programming interface and graphics pipeline. Direct3D is presented as Microsoft's API for Windows, focused on gaming performance. Key differences between OpenGL and Direct3D are portability, functionality, and performance.
3. Overview
• Today 3D graphics tools provide new methods in engineering,
medicine, entertainment and technology
• These are selected from exhaustive online research
• Incorrect selection can lead to undesired results
• A graphics library is a software interface to graphics hardware
commonly called the APIs
• It provides a set of graphics commands and functions which can
specify primitive geometric models and their attributes to digitize
and display
4. Common Graphics Libraries
A graphics programmer is should be able to program in at least one of
the following:
• OpenGL
• Direct3D
• PHIGS (Programmer's Hierarchical Interactive Graphics System)
• GKS (Graphics Kernel System)
5. PHIGS (Programmer's Hierarchical Interactive
Graphics System)
• An API standard for rendering 3D computer graphics through 1980s
• Available as a standalone implementation like IBM’s GraPHIGS or
Sun’s SunPHIGS
• Became a standard by 1990s ( ANSI and ISO)
• Supports only the most basic 3D graphics, including basic geometry
and meshes
• A combination of features of PHIGS and power led to the rise
of OpenGL
6. Features of PHIGS
• Included a scene graph which is a data structure for storing logical
sequences
• Had a CSS (Centralized Structure Store) i.e. a database for storing
primitives and their attributes
• CSSes were shared under workstations to give views
• Simple working:
Model built into CSS Workstation created and opened Model
connected
7. OpenGL (Open Graphics Library)
• Most widely adopted graphics API
• Easy to use, well documented
• Cross platform and cross language
• Everything is primitive (can accept only simple shapes and sizes)
• Largely built on C but can be used in most programming languages
9. void display(void)
{
int x, y;
//a. generate a random point
x = rand() %Width;
y = rand() % Height;
//b. specify a drawing color: red
glColor3f(1, 0, 0);
//c. specify to draw a point
glBegin(GL_POINTS);
glVertex2i (x,y);
glEnd();
//d. start drawing
glFlush();
}
Basic Commands for Drawing and Shape
void drawtriangle(float *v1, float *v2, float *v3)
{
glBegin(GL_TRIANGLES);
glVertex3fv(v1);
glVertex3fv(v2);
glVertex3fv(v3);
glEnd();
}
12. Color and Lighting
• Different colors for different vertices of the model can be
specified
• Light sources can be put to give different colors at different
positions in the environment, so the model can have overall
brightness, dull reflections, and/or shiny spots
• Lighting can be achieved by calculating the color of a pixel
• The normal of the pixel, the position of the viewer, and the
colors and positions of the light sources inherently decide
the lighting
13. Transparency
▪ Used for transparent objects by implementing transmission
coefficients for overlapping objects
▪ A final pixel’s R,G or B value depends on the blending of the
corresponding R, G, or B values of the pixels in the
overlapping objects through the transmission coefficients:
Iλ = a1Iλ1 + a2 Iλ2, where λ is R, G, or B; Iλ the blended color
component, a1 the transmission coefficient of the pixel in
the first object, and Iλ1 the color of the first object.
14. Direct3D
• Graphics API for Microsoft Windows
• Used to render 3D applications where performance is important
like gaming environments
• Implemented onWindows family of operating systems
• Also on embedded versions of Xbox family of video game
consoles
15. How’s Direct3D Different?
▪ Portability – OpenGL is cross platform while Direct3D is Windows
centric
▪ User Functionality – Direct3D is 3D hardware interface while
OpenGL is 3D rendering system that could be hardware accelerated
▪ Performance – Direct3D is more suitable when performance is
considered because of lighter codes
▪ Users/Applications – OpenGL has always seen more number of
users. Direct3D is mostly used for computer games