Computer graphics -- 2008-2009 -- 1

From Wikiversity
Jump to navigation Jump to search

Quick links: front; laboratories agenda, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, JOGL template.


Please consult Computer graphics -- 2008-2009 -- agenda.


Please consult Computer graphics -- 2008-2009 --


Please consult Computer graphics -- 2007-2008 -- tools.


Computer graphics[edit]

Computer graphics definitions :

  • Is a sub-field of computer science which studies methods for digitally synthesizing and manipulating visual content. Although the term often refers to the study of three-dimensional computer graphics, it also encompasses two-dimensional graphics and image processing wikipedia:Computer graphics
  • Is the pictorial representation and manipulation of data by a computer [1]
  • Is the set of technologies used to create art with computers. Art or designs created using such technologies [2]

It studies :

  • the manipulation of visual and geometric information using computational techniques.
  • algorithms to reproduce physically photo-realistic images

The following can be seen as sub-parts of it:

  • Geometry -- studies methods to represent and process surfaces
  • Animation -- studies methods to represent and manipulate motion
  • Rendering -- represents images staring from models by using computer programs
  • Imaging -- studies image acquisition and editing.


2D / 3D graphics[edit]

2D graphics
implies computer-based generation of digital images (or image sequences -- animation), from (mostly 2-dimensional) models (like geometric shapes, text, other digital images), and manipulation techniques (rotation, translation, scaling, transparency, blending etc.).
3D graphics
(just like 2D graphics) implies computer-based generation of digital images (or image sequences), from 3-dimensional geometric shapes.

Both 2D and 3D graphics are an umbrella for methods / algorithms from all subfields (like geometry, rendering and imaging).

It generally implies the following steps:

  • Modeling;
  • Defining/determining the scene layout;
  • Rendering the scene (includes objects);

As a comparison of the two, the output is the same -- a 2-dimensional image (or sequence) --, but the inputs are different -- 2D shapes / 3D shapes.


Digital images[edit]

A Digital image
is the representation of an image as a 2 dimensional matrix of values -- pixels -- which encode the color of the corresponding image point.


Image Resolution[edit]

The image resolution represents the quantity of information stored in a digital image. This usually refers to the number of pixels that compose the image;


Color depth[edit]

Bits per pixel
the number of bits allocated / used to encode the color for each pixel.

Tipical cases:


Color spaces[edit]

Color space
a mathematical method to represent (encode) a color, usually like a tuple of numbers (integers or reals).


File formats[edit]

Images are usually stored on disk using various formats such as BMP, PNG, TGA, JPEG, etc. Each of the formats has its own (compressed/uncompressed) way of representing the pixel data found in the image but in most of the cases it reduces itself to coding pixel data (number, color depth, color space) and other file/image related information.


Graphics Processing Unit (GPU)[edit]

A dedicated rendering device either integrated within the motherboard or attached to a video card. Its purpose is to handle graphics specific operations. It incorporates several graphics primitive operations (2D/3D) which makes rendering much faster than when rendering directly on screen by using the CPU.




OpenGL stands for Open Graphics Library;

  • it was developed by Silicon Graphics in 1992;
  • its present version is 3.0 and was released in August 11th 2008
  • is a specification for cross-platform API (Application Programmable Interface);
  • it describes a set of functions, their inputs and outputs, and the resulting behaviors;
  • it is used for 2D or 3D graphics;

Among its purposes we can note:

  • hide hardware interfacing details;
  • provide an unified programmable interface;
  • it provides a procedural paradigm scene description, meaning that the programmer has to describe all the steps that are required to render a scene -- thus being a low-level library;
    • hardware manufactures design hardware to meet the feature requirements, meanwhile software implementors develop libraries that meet the standard functionality;
    • it focuses only on rendering, and not on windowing, keyboard / mouse input, or network related issues;
      • as a result a number of utility libraries have been built on top of it:
        • GLU (OpenGL Utility Library ) : provides higher-level drawing routines than OpenGL
        • GLUT (OpenGL Utility Toolkit) : utilities which primarily perform system-level I/O with the host computer (window definition, window control, monitoring of keyboard and mouse input, limited support for creating pop-up menus, etc.)
        • GLUI (OpenGL User Interface Library) : based on GLUT it provides controls such as buttons, check-boxes, radio buttons, and spinners to OpenGL applications. It is platform independent
        • SDL (Simple DirectMedia Layer) : presents a simple interface to various platforms' graphics, sound, and input devices. It is platform independent
        • etc.




  • was created by Microsoft and first released in 1995
  • its present version is 11 and was released on February 4th 2009 (added multi-threading support, GPGPU support and tessellation support)
  • it runs only on Microsoft platforms (Windows and Xbox)
  • is a collection of different APIs, each focusing on a specific task
  • is used mainly in game development, but also for CAD (Computer Aided Design)
  • is not a standard specification, but a closed-source software
  • is composed of:
    • RT -- runtime -- needed to run an application using DirectX (usually it is bundled with application installation kits, but also ships with the operating system)
    • SDK -- software development kit -- needed to develop an application using DirectX
  • like OpenGL the developer describes the scene for each step -- immediate mode
  • initially it included an implementation of the scene graph paradigm -- retained mode;
  • its sub-APIs are:
    • DirectDraw -- used for 2D graphics;
    • Direct3D -- used for 3D graphics;
    • XInput (former DirectInput in versions < 10)-- used for keyboard and mouse input;
    • DirectPlay -- used for network / multi-play related tasks (in version 10 the dplay.dll was removed and replace by dplayx.dll);
    • XACT (former DirectSound in versions < 10) and DirectMusic -- used to play or record sounds;
    • DirectShow -- removed as of 2005 but backwards compatibility still present


Java 2D / Java 3D[edit]

Java 2D / Java 3D:

  • Java 2D is an API for drawing 2D shapes
  • Java 3D is an API for drawing 3D objects
  • Java 3D runs on top of either OpenGL or DirectX
  • is more than a wrapper by using a real OOP concepts
  • Java 3D uses scene graph paradigm, but has also immediate mode


JOGL -- Java OpenGL[edit]

  • its latest version is 1.1.1 and was released in May 22nd 2008
  • is a wrapper for OpenGL, mirroring all the GL functions, thus retaining the same API feeling
  • as OpenGL it does not include window related calls and there is no utility library for these tasks. Thus it relies an Java specific libraries (AWT, SWING) to create GUI based applications
  • delegates calls to OpenGL using JNI (Java Native Call)
  • since version 1.1.0 it provides full access to GL 2.0 features
  • conversion between OpenGL code written in C, and OpenGL code written in Java is extremely easy, due to the direct mapping (naming) of GL functions
  • since Java SE 6, Java 2D and Java OpenGL have become inter-operable -- allowing developers to mix code



  • was created by Microsoft and first released in 2004
  • its latest version is 3.0 released in October 30th 2008
  • it is based on .Net Framework;
  • is comprised of a set of tools with a managed runtime environment which facilitate computer game
  • it tries to remove the boilerplate code;
  • it tries to allow developers to focus on game content and experience;
  • it is usable from any .NET language (like C#);


X3D (former VRML)[edit]

  • first appeared in 1994 as VRML (Virtual Reality Modeling Language). VRML97 dating back from 1997 is the last version of it. It is a standard file format for representing 3-dimensional interactive vector graphics designed for use on the Internet (WWW)
  • it was re-engineered as X3D whose abstract specifications were approved in 2004. XML and ClassicVRML encodings were approved in 2005
  • the current version of X3D is 3.2
  • it has an XML based syntax