image synthesis rabie a. ramadan, phd 1. 2 about my self rabie a. ramadan my website and...

Post on 13-Jan-2016

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Image Synthesis

Rabie A. Ramadan, PhD

1

2

About my self

Rabie A. Ramadan

My website and publications • http://www.rabieramadan.org

3

Class Rules

I am not here to punish you

Trust yourself and do your best

I want you to learn and compete with others working on the same field

I want you to be confident when you speak with others

Class Rules

You can bring anything to drink but NO FOOD PLEASE

When you come in , DO NOT knock on the door

When you want to leave , do not tell me Just leave but you will be counted as absent• I do not take attendance every class but sometimes I

do

5

Class Rules

Attendance is a vey important

Assignments must be delivered on time

• All assignments are individual assignments unless it is clearly stated that you can work on groups.

• Assignments or part of them that are copied (including the programming assignments) will not be counted towards your grades.

6

Class Information

Textbook

7

Class Information Website

http://www.rabieramadan.org/classes/2011/image/

OpenGl and Image Synthesis

Two principal tasks are required to create an image of a three-dimensional scene: • Modeling

• Rendering.

OpenGl and Image Synthesis

Modeling : • The description of an object that is going to

be used by the graphics system. E.g mathematical model.

• Models must be created for every object in a scene;

• Accurately capture the geometric shape and appearance of the object.

OpenGl and Image Synthesis

Rendering: • Takes models as input and generates pixel values

for the final image.

OpenGL: • Principally concerned with object rendering;

• it does not provide explicit support for creating object models

What is OpenGL?

A software interface to graphics hardware

Graphics rendering API (Low Level) • High-quality color images composed of geometric and

image primitives

• Window system independent

• Operating system independent

OpenGL Basics Rendering

• Typically execution of OpenGL commands• Converting geometric/mathematical object descriptions

into frame buffer values OpenGL can render:

• Geometric primitives • Lines, points, polygons, etc…

• Bitmaps and Images• Images and geometry linked through texture mapping

Graphics Pipeline

Polygonal Representation

A simple object, such as a box, can be represented using a polygon for each face in the object.

Modeling task consists of :

• Determining the 3D coordinates of each vertex in each polygon that makes up a model.

• To provide accurate rendering of a model’s appearance or surface shading,

• the modeler may also have to determine color values, and texture coordinates for the model’s vertices and faces.

Decomposition and Tessellation

Tessellation • The process of decomposing a complex surface.

• A sphere simpler primitives such as triangles.

OpenGL does not specify a decomposition algorithm

Tessellation

latitude-longitude tessellation for a sphere

Octahedron easily splits into four triangles

Shading Normals

Normals are perpendicular the surface,

You can find the normal at a particular point on a surface by

• First Finding the flat plane that just touches the surface at that point.

The normal is the vector that’s perpendicular to that plane.

Shading Normals

Smooth Shading

Example for more than one polygon

Shading Normals

Selecting the vectors depends on the type of polygon.

Triangle Stripping

To speedup OpenGL and save space, polygons are divided into triangles strips.

Decide whether the first triangle should have a clockwise or counterclockwise winding

Triangle strip winding.

Triangle Stripping

Triangle fan winding

Triangle Stripping

OpenGL does not have a way to specify generalized triangle strips.

• The user must choose between GL_TRIANGLE_STRIP and GL_TRIANGLE_FAN

The triangle strip is the more versatile primitive.

The triangle fans are ideal for large convex polygons

Triangle Stripping For regular meshes, triangle strips should be lined up side

by side. The goal here is to minimize the number of total strips and

try to avoid “orphan” triangles (also known as singleton strips)

Greedy Tri-stripping

A simple method of converting a model into triangle strips.

For OpenGL,• A better algorithm is to choose a polygon, convert it to

triangles, then move to the polygon which has an edge that is shared with the last edge of the previous polygon.

• A given starting polygon and starting edge determines the strip path.

• The strip grows until it runs off the edge of the model or reaches a polygon that is already part of another strip

Example

“Greedy” triangle strip generation.

C# Code

How to install OpenGL http://www.videotutorialsrock.com/opengl_tut

orial/get_opengl_setup_windows/video.php

top related