Title: 3D Graphics
13D Graphics
- 3D Graphics Pipeline
- Modelling
- TUTORIAL3D Graphics with POVRay
2(No Transcript)
3Three-dimensional Graphics
- 3D Graphics is characterised more by the 3D
nature of the Models (input into rendering)
rather than the final display (output) modeling
world - In most cases, our output devices are limited to
2D, so we need to utilise techniques to render
these objects with the illusion of the third
dimension of depth
4Three Dimensional Concepts
- 3D viewing positions
- projection
- depth cueing
- visible line and visible surface identification
- surface rendering
- three-dimensional views/ stereoscopic views
53D GRAPHICS PIPELINE
WORLD/SCENE/OBJECT/CONCEPT
Modelling coordinates - world coordinate system,
- object coordinate system
3D MODELLING
VIEWING
3D CLIPPING
Camera coordinates
PROJECTION
Screen/Window coordinates
RASTERIZATION
Device coordinates
2D PIXELMAP DISPLAY
6Modelling
Implicit
3D Modelling
Polygonal
Volumetric
Parametric
7Viewing and Projection
3d models
camera setup
viewport
8Camera Positioning
Different views of a 3D model
9Projection
Representing three dimensions on two dimensional
media by Projection
10Albrecht Dürer (1471-1528).
11Vermeer
12Depth Cues
Shadows as depth cues
Perspective and Depth of Field
Highlight/Shadow
13Surface Rendering
Light and shadow colour of diferent parts of an
object suggest its three -dimensional nature
14Rasterization
Although the images are flattened to 2D, there is
some depth knowledge required on how to order them
15Modelling
16Goals
- Technical Goals
- Storage on digital memory
- Aim for a concise, unambiguous description of
concept - In graphics, optimise model for visual output
- Aesthetic Goals
- Look appealing
- Look Real? (maybe)
- Look the way we want it to
17Modelling Objects
- Basic requirements The shape of an object
- Additionally we may require
- Topology (interconnections, normals)
- Material Properties
- Colour
- Shininess
- Transparency
- Behavioural Information
- e.g. Density, Importance,
- Modeling decisions based heavily on the target
application the rendering system
18Rendering
- What do rendering systems require?
- Consider
- Speed Do we require Real-time, Interactive or
Offline rendering - Space limitations
- Re-use?
- Rendering limitations (software/hardware)
19Wire frame rendering
Largely, only edge/surface data is required
20Filled Polygons
Colour/Weight/Name is required for each region
21Basic Shading
22Shading
The vectors N, L, V, R need to be stored or
evaluated
We need to know material colour, texture and
finish
23Phong Shading
24Reflectance Models
How different materials reflect incoming light
determined by roughness or finish
Basic Shading (Perfect Diffuse)
Perfect Mirror
Phong Highlight
Diffuse
25Advanced Illumination
- Offline methods employ more detailed simulations
of light transfer - Some of these now possible in real-time due to
high-end graphics hardware
26Ray tracing
27Ray Tracing
The colours of light reflected from one point are
also dependent on indirect light bouncing off
other objects in the scene.
28Texture Mapping
29Texture Mapping
l
n
v
r
Lighting calculations as per usual but with
material properties (or colour values) varying
across the polygon.
30Bump Mapping
31Bump Mapping
A real bump distorts the directions of the
normals (this effects calculations of light
reflectance)
Fake bumps created by distorting the normals
although the geometry is still flat.
A bump-map texture applied to a flat polygon.
32Radiosity
33Modelling Shape
- Boundary Representation Surface Models
- Spatial Partitioning Volume Models
- Mathematical Models
- Discrete Models
34Surface Representations
- Polygon Mesh a.k.a. Wire frame
35Mathematical Models
- Parametric/Implicit
- Evaluators
Implicit
Parametric
36Discretization
300 polygons
120 polygons
1000 polygons
48 polygons
In most cases, mathematical models need to be
converted to discrete representations before we
use them in scenes. We need to find an
appropriate resolution for this.
37Volumetric Modules
Constructive Solid Geometry
38Volumetric Models
- Voxels (Volume elements/Volumetric pixels)
39Modelling Scenes
Modelling complex scenes made up many objects is
a two step process of modelling individual
objects and then placing these in the scene
(using transforms)
40Object Transformations
scaling
translation
rotation
41Scene Graphs
TRINITY
Individual object geometries are first modelled.
These are then linked using positional/orientation
al relationships (transforms)
42A Scene Graph
Body
Hood Trunk Front Bumper Rear Bumper Left Door
Left Door Glass Right Door Right Door
Glass Left Front Wheel Right Front Wheel Left
Rear Wheel Right Rear Wheel
There can be multiple levels of transforms e.g.
the door glass is linked to the door which is
linked to the body
43Sources of Visual Data
- Automated Acquisition
- Scanning
- Digital Cameras (Images and Video)
- Mathematical Models
- Mathematical curves and shapes
- Procedural Modelling
- Experimental Data
- Hand-coded Models (OR Hand Coded Scenes made up
of Models that have been acquired from elsewhere) - More on acquisition and Mathematical Modelling
later
443D Studio Max
45Sources of 3D Data
463D scanner data usually very detailed often
requires some downsampling (simplification)
47Level of Detail
7,809 tris
488 tris
975 tris
1,951 tris
3,905 tris
Select the right number of polygons/triangles for
a specific purpose (e.g. for distant views,
low-end machines use less triangles)
48POVRay
49POVRay
- A popular free High-quality tool for 3D graphics
- Available for Windows, Mac, Linux
- Get it at http//www.povray.org
- Scenes are stored in a simple text file with a
.POV extension
50Optional Libraries
- A number of pre-defined high-level functions are
provided in the optional libraries. - These are included as required using the include
directive - e.g.
- include colors.inc
- include shapes.inc
- include textures.inc
51Vectors
- Colours, Positions and Directions are represented
using vectors e.g. - rgb lt1, 1, 1gt
- rgbf lt0, 0, 1, 0.5gt
- translate lt0, 1, 1gt
- colors.inc includes some named colors e.g.
Blue, White, Red. If you want to use this in your
model, insert the following at the start of the
file - include colors.inc
52Comments
- Comments can be included in a similar way to java
script e.g. - texture
-
- pigment //this is a single line comment
-
- color Blue
- / this is a multi-line comment
- Still a comment
- Last line of comment /
-
53Camera Positioning
- The following is a simple set-up you can use for
now - camera
-
- Perspective
- location lt0, 0, -10gt
- direction lt0, 0, 1gt
- up lt0, 1, 0gt
-
- There are other options you can use for modelling
a camera. e.g. instead of a direction, you can
specify a target point (or look_at point) that
the camera always points to. - We will discuss camera modelling in more detail
in later lectures
54Light Source
- For any object to be rendered visible, we require
at least one light source or emissive object - light_source
-
- lt5, 5, 5gt // position
- rgb lt1, 1, 1gt //colour
-
55Simple Objects
- A few basic shapes are provided in the shapes.inc
library e.g. the sphere is declared with a vector
specifying the location of its center and a
radius - sphere lt0, 0, 0gt, 2
- Material properties and transformations can also
be included within the object description e.g. - sphere
-
- lt0, 0, 0gt, 2
- pigment rgb lt1, 0, 0gt
- rotate lt4, 0, 0gt
-
r
c
56Simple Objects Planes
- Infinite planes are defined by a normal direction
and a distance from the origin e.g. - plane
-
- lt1, 1, 0gt, 2
- pigment Blue
n
d
57Simple Objects Cuboids
- Boxes are defined by a the positions of two
opposite corners e.g. - box
-
- lt-1,-1,-1gt, lt1, 1, 1gt
- rotate 30lt0, 1, 0gt
- pigment White
58Texture pigment
- Objects material properties are defined in the
texture command which can be inserted into the
object declaration - The first part of the texture specifies the
object colour - texture
-
- pigment
-
- rgb lt1, 0, 0gt
-
-
- POVRay allows you to take a shortcut and leave
out the texture part if you wish to just
declare a simple pigment - At the very least you need to specify a pigment
for each object you declare -
59Texture finish
- The finish command specifies the objects material
properties such as shininess/gloss (more on this
next week) - texture
-
- pigment
-
- Red
-
- finish
-
- reflection 0.5
- brilliance
-