Computer graphics -- 2007-2008 -- info.uvt.ro/Laboratory 1

From Wikiversity
Jump to navigation Jump to search
Important! These pages are somehow outdated and it is recommended to consult the newer version at Computer graphics -- 2008-2009 -- info.uvt.ro (by Marc Frâncu).

Quick links: front; laboratories agenda, 1, 2, 3, 4, 5, 6, 7, 8, evaluation, tools, repository.


Introduction[edit]

Computer graphics[edit]

Computer graphics
  • computer graphics is a subfield of computer science and is concerned with digitally synthesizing and manipulating visual content (2D or 3D image processing).
  • computer graphics broadly studies the manipulation of visual and geometric information using computational techniques.

Links:

Subfields[edit]

Geometry
studies methods to represent and process surfaces.
Animation
studies methods to represent and manipulate motion.
Rendering
  • studies algorithms to reproduce physically photo-realistic images;
  • it usually implies light transport simulation;
  • Rendering is a process for generating an image from a model by means of computer programs.
Imaging
studies image acquisition and editing.

Links:

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 techinques (rotation, translation, scaling, transparency, 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;
  • scene layout;
  • rendering;

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.

Links:

Digital images[edit]

Digital image
is the representation of an image as a bidimensional matrix of values -- pixels -- which encode the color of the coresponding image point.

Links:

Resolution[edit]

Resolution
  • the quantity of information stored in a digital image;
  • usually it represents the number of pixels that compose the image;

Links:

Color depth[edit]

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

Tipical cases:

Links:

Color spaces[edit]

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

Links:

File formats[edit]

Links:

Technologies[edit]

OpenGL[edit]

  • OpenGL stands for Open Graphics Library;
  • 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;
  • it was developed by Silicon Graphics in 1992;
  • hardware manufactures design hardware to meet the feature requirements, meanwhile software implementors develop libraries that meet the standard functionality;
  • purposes:
    • 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;
  • there are a number of utility libraries built on top of OpenGL: GLU, GLUT, SDL;
  • it focuses only on rendering, and not on windowing, keyboard / mouse input, or network related issues;

Links:

DirectX[edit]

  • it is a collection of different APIs, each focusing on a specific task;
  • it is used mainly in game development, but also for CAD;
  • it is not a standard specification, but a closed-source software;
  • the sub-APIs are:
    • DirectDraw -- used for 2D graphics;
    • Direct3D -- used for 3D graphics;
    • DirectInput -- used for keyboard and mouse input;
    • DirectPlay -- used for network / multi-play related tasks;
    • DirectSound and DirectMusic -- used to play or record sounds;
    • DirectShow;
  • it 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;
  • it was created by Microsoft and first released in 1995;
  • it runs only on Microsoft platforms (Windows and Xbox);
  • like OpenGL the developer describes the scene for each step -- immediate mode;
  • initially it included an implementation of the scene graph paradigm -- retained mode;

Links:

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;
  • it is more than a wrapper by using a real object oriented concepts;
  • Java 3D uses scene graph paradigm, but has also immediate mode;

Links:

JOGL -- Java OpenGL[edit]

  • 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;
  • delegates calls to OpenGL using JNI;
  • from 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 interoperable -- allowing developers to mix code;

Links:

XNA[edit]

  • is a set of tools that facilitates computer game design and development;
  • it tries to remove the boilerplate code;
  • it tries to allow developers to focus on game content and experience;
  • it is based on .Net Framework;
  • it is usable from any .NET language (like C#);
  • it was created by Microsoft in 2004;

Links:

Agenda[edit]

Please consult Computer graphics -- 2007-2008 -- info.uvt.ro/Laboratory agenda.

Evaluation[edit]

Please consult Computer graphics -- 2007-2008 -- info.uvt.ro/Laboratory evaluation.

Tools, frameworks and libraries[edit]

Please consult Computer graphics -- 2007-2008 -- info.uvt.ro/Laboratory tools.

Assignment[edit]

This is the first assignment, so please commit it to the folder assignment-01.

Write an essay that presents a comparative study between -- at least two of -- the following technologies:

  • OpenGL;
  • DirectX -- focusing on Direct3D;
  • Java 2D / 3D -- focusing on Java 3D;
  • JOGL;
  • XNA;

It should touch the following topics:

  • history -- birth and evolution;
  • standardization, backing enterprises and organizations, industry acceptance;
  • compatible hardware and software platforms (on which operating systems are they available, for which programming languages do bindings exist);
  • features (what is available to the programmer in the latest versions);
  • programming paradigms (is the framework object oriented or is it closer to structured programming);
  • advantages and disadvantages;

The paper should pay special attention to the features and advantages / disadvantages, and it must also contain the bibliography.

It should be 2-3 pages in length, and formatted accordingly to the following rules:

  • A4 paper size with a 2.5 cm margin on all directions;
  • 12 pt Times New Roman, spaced at most 1.5 lines;
  • only PDF or DOC, but not DOCX (as created by Microsoft Word 2007);

The paper should not contain copied information unless quoted and only sparingly.

For submission and evaluation please consult Computer graphics -- 2007-2008 -- info.uvt.ro/Laboratory evaluation.