Tải bản đầy đủ (.pdf) (11 trang)

Bài giảng Đồ họa máy tính: Bài 1 - Lê Tấn Hùng

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.75 MB, 11 trang )

Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

Tổng quan về kỹ thuật đồ hoạ

Lesson 1:
Kỹ thuật đồ họa và Hiện thực ảo
Computer Graphics And Virtual Reality

‰

Các khái niệm tổng quan của kỹ thuật đồ hoạ máy
tính

‰

Các kỹ thuật đồ hoạ

„

Kỹ Thuật đồ họa cơ sở

‰

Phân loại các lĩnh vực của kỹ thuật đồ hoạ

„

Kỹ Thuật đồ họa tiên tiến
Hiện thực ảo - VRML



‰

Hệ đồ họa tương tác (interactive)

‰

Phần cứng đồ hoạ (Graphics Hardware)

„

Le Tan Hung

(c) SE/FIT/HUT 2002

(c) SE/FIT/HUT 2003

A Brief History of Computer
Graphics

A Brief History of Computer
Graphics
1926 – J.L. Baird
invents the
television.

1885 - CRT (Cathode Ray Tube)

1887 - Edison patents motion
picture camera

1888 - Edison and Dickson
record motion picture photos
on a wax cylinder

(c) SE/FIT/HUT 2003

30 line vertical,
black and red scan.

3

A Brief History of Computer
Graphics

„

4

1966

IBM creates the 360 models
„

(c) SE/FIT/HUT 2003

A Brief History of Computer
Graphics

1963
„


2

„

One of the First General
Purpose Mainframes

Ralph Baer creates the 1st comsumer CG product:

Odyssey Pinball

SRI develops the mouse.

(c) SE/FIT/HUT 2003

5

(c) SE/FIT/HUT 2003

6

1


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

A Brief History of Computer

Graphics

A Brief History of Computer
Graphics
1968

1967
„

„

GE introduces first full colour real time flight
simulator for NASA

(c) SE/FIT/HUT 2003

7

A Brief History of Computer
Graphics
Michael Crichton’s
“Westworld” uses 2D graphics

„

First time computer is used for image
manipulation.
Featured scenes that showed
audiences the world viewed by the
eye circuitry of a synthetic human

(played by a very real Yul Brenner) in
a future Western theme park. This
effect was achieved with 2D
computer graphics tools mostly
derived from image processing
techniques.

„

(c) SE/FIT/HUT 2003

„

„

Mandelbrot plots fractals

„

Bill Gates starts Microsoft
(c) SE/FIT/HUT 2003

10

A Brief History of Computer
Graphics

1977

Steve Jobs and Steve Wozniak start

Apple.

„

Star Wars wins oscar for
special effects.

1978

Academy of Motion Pictures Art
and Sciences introduces Visual
Effects category for Oscars.
(c) SE/FIT/HUT 2003

Intel develop the 8080 processor.

9

1977
„

8

1975

A Brief History of Computer
Graphics
1976
„


(c) SE/FIT/HUT 2003

A Brief History of Computer
Graphics
1974

1973
„

John Whitney: Permutations

In "Permutations," (1968) he
delineates a marvellous and exciting
new world. One senses a
choreographer. The movements are
reminiscent of traditional ballet. The
shapes follow the dictates of formal
geometry more than those of abstract
painting. Movement is threedimensional and the ambition for a
more polished three-dimensional
shaded space is apparent.

•Superman wins oscar for
special effects.
11

(c) SE/FIT/HUT 2003

12


2


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

A Brief History of Computer
Graphics

A Brief History of Computer
Graphics
1980

1979
„

Alien wins oscar for visual
effects.

1980

„

Disney’s TRON is the first
live action film with over
20 mins of computer
animations.

„


Seagate Technology
releases the HDD for PCs

•The Empire Strikes Back
wins oscar for visual effects.
(c) SE/FIT/HUT 2003

13

(c) SE/FIT/HUT 2003

A Brief History of Computer
Graphics

A Brief History of Computer
Graphics
1982

1981 IBM introduces the first IBM PC (16 bit

„

8088 chip)
• Raiders of the
Lost Ark wins
an oscar for
visual effects.

(c) SE/FIT/HUT 2003


„

„

(c) SE/FIT/HUT 2003

16

A Brief History of Computer
Graphics

1984 PIXAR Opens

1985

First Coke Polar Bears
Commercial

„

(c) SE/FIT/HUT 2003

The Genesis Effect (ILM)
for Startrek II is the first
all computer animated
visual effects shot for
film.

15


A Brief History of Computer
Graphics
1983

14

17

The Last Starfighter is the
first live action feature film
with realistic computer
animation of highly detailed
models.

(c) SE/FIT/HUT 2003

18

3


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

A Brief History of Computer
Graphics
1989
„


A Brief History of Computer
Graphics
1990

The Abyss is the first
movie to include
convincing 3D character
animation.

„

Windows 3.0 ships

1993
„

Myst

1994
„

(c) SE/FIT/HUT 2003

19

A Brief History of Computer
Graphics
1995
„


Quake Released by
Id Software

„

Toy Story becomes
the first fully 3D
computer animation
feature film.

Independence Day
wins oscar for visual
effects.

21

(c) SE/FIT/HUT 2003

22

A Brief History of Computer
Graphics
1998

Titanic wins oscar
for visual effects.

„
„

„

„

20

A Brief History of Computer
Graphics
1996

A Brief History of Computer
Graphics
1997
„

(c) SE/FIT/HUT 2003

„

(c) SE/FIT/HUT 2003

Playstation and N64 released

PIXAR wins oscar
for best short film:
Geri’s Game.

Armageddon
Mouse Hunt
Bugs Life


1999
„
„
„
(c) SE/FIT/HUT 2003

23

The Matrix
Star Wars: The Phantom Menace
Disney’s Tarzan
(c) SE/FIT/HUT 2003

24

4


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

A Brief History of Computer
Graphics
2000
„
„
„


Kỹ thuật đồ họa vi tính.

2002 Microsoft’s XBOX

„

Definition (ISO)

Computer Graphics (Kỹ thuật đồ hoạ máy tính)
„ Computer graphics deals with all aspects of
creating images with a computer
model –
Interactive Computer Graphics:
„

Sony Playstation II
Walking with Dinosaurs
Disney’s Shrek

(c) SE/FIT/HUT 2003

25

Kỹ thuật đồ hoạ điểm
(Sample based-Graphics)
„

Các mơ hình, hình ảnh của các đối tượng được hiển thị
thông qua từng pixel (từng mẫu rời rạc)


„

Đặc điểm:

„

Phương pháp để tạo ra các pixel

26

(c) SE/FIT/HUT 2003

Pascal / C
program

Bitmap

SRGP
library
positions

lines,areas,...

X Window
System

graphics algorithms
colour

Graphics hardware


Image
image formats, compression, transfer

(c) SE/FIT/HUT 2003

27

Kỹ thuật đồ hoạ vector
Graphical
Model

Rendering
Parameters

„

(c) SE/FIT/HUT 2003

Ví dụ về hình ảnh đồ hoạ Vector

Vector = geometrical
model + rendering

Rendering

Output
Device

(c) SE/FIT/HUT 2003


29

(c) SE/FIT/HUT 2003

30

5


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

Raster and Vector Graphics
„

Wireframe Model

Skeletal Model

Muscle Model

„

Raster
„

Hình ảnh và mơ hình của các vật thể được biểu diễn bởi tập hợp các
điểm của grid


„

Thay đổi thuộc tính của các pixel => thay đổi từng phần và từng vùng
của hình ảnh.

„

Copy được các pixel từ một hình ảnh này sang hình ảnh khác.

Vector
„
„

„

Khơng thay đổi thuộc tính của từng điểm trực tiếp
Xử lý với từng thành phần hình học cơ sở của nó và thực hiện q
trình tơ trát và hiển thị lại.
Quan sát hình ảnh và mơ hình của hình ảnh và sự vật ở nhiều góc
độ khác nhau bằng cách thay đổi điểm nhìn và góc nhìn.

© Walt Disney and TSL

Skin

Hair

(c) SE/FIT/HUT 2003


Render and Touch up

31

(c) SE/FIT/HUT 2003

Phân loại các lĩnh vực ca
Computer Graphics

Phõn loi theo h to
Kỹ thuật đồ hoạ 2 chiều

CAD/CAM System
Kiến tạo đồ
hoạ

Đồ hoạ minh hoạ

Kỹ thuật đồ hoạ

Đồ hoạ hoạt hình và
Kỹ thuật đồ
hoạ

32

Kỹ thuật đồ hoạ ba chiều

nghệ thuật


Xử lý ảnh
Xử lý đồ
hoạ

Kỹ thuật nhận dạng

Kỹ thuật phân tích và
tạo ảnh
(c) SE/FIT/HUT 2003

33



K thut x lý ảnh (COMPUTER IMAGING)

„

„

Kỹ thuật nhận dạng (Computer Vision techniques

„

attempt to provide meaning to computer) images.

„

„


Kỹ thuật tổng hợp ảnh (Computer Graphics)

„

Geometry modelling

(c) SE/FIT/HUT 2003

34

Các ứng dụng tiêu biểu của kỹ
thuật đồ họa

Phân loại theo chức năng
„

(c) SE/FIT/HUT 2003

„
„
„

35

Xây dựng giao diện người dùng (User Interface)
Tạo các biểu đồ trong thương mại, khoa học, kỹ thuật
Tự động hố văn phịng và chế bản điện tử
Thiết kế với sự trợ giúp của máy tính (CAD_CAM)
Lĩnh vực giải trí, nghệ thuật và mơ phỏng
Điều khiển các quá trình sản xuất (Process Control)

Lĩnh vực bản đồ (Cartography)

(c) SE/FIT/HUT 2003

36

6


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

37

(c) SE/FIT/HUT 2003

CAD-CAM application

(c) SE/FIT/HUT 2003

Hệ đồ họa tương tác
ƒ
ƒ

ƒ
ƒ

Mơ hình hệ đồ hoạ tương tác
Các thành phần của hệ đồ hoạ tương tác

Bộ xử lý tương tác với người sử dụng
Các chuẩn của hệ đồ hoạ

39

(c) SE/FIT/HUT 2003

38

Thành phần trong chức năng của
kỹ thuật đồ hoạ

(c) SE/FIT/HUT 2003

40

Các thà
thành phầ
phần của hệ đồ hoạ
hoạ tương tác

GUI
MODELING

( to describe)
to the computer
what is
a table, a car, •
••


Geometric Engine
concerned with:
- modeling
- modeling transf.
- color models
- material property
- lighting property

RENDERING

DISPLAYING

(to capture)
the description
create 2D image
from 2D / 3D
models
Rendering Engine

(to show)
the image
generate
image on
screen

Application
Data
Structure

Application

Program

Graphics
System

Raster & Display Engine

concerned with :
- viewing & projection
- drawing & clipping
primitives
- local illumination &
shading
- texture mapping
- global rendering
(c) SE/FIT/HUT 2003

concerned with:
- hardware
- how to display
(rasterization)

Computer
41

Graphics Devices

(c) SE/FIT/HUT 2003

42


7


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

3D Graphics Over World Wide
Web
Animation

Model of RGP
output pipeline

Drawing
packages

Pascal / C
program

output primitives

transformation
of objects

output attributes

Application
model


Canvascontrol

Application
program

copyPixel
Input device control

positions

Display Hardware

WWW

projections
lighting,shading

SRGP
library

SRGP

VRML

3D Graphics

graphics algorithms
colour


lines,areas,...

Input device measures

X Window
System

input pipeline
WWW
(c) SE/FIT/HUT 2003

43

Các thực thể cơ sở

ƒ
„

Đa giác (polygon) ..v..v.

ƒ

„

ƒ
ƒ

„

„


„

„

hệ thống đồ hoạ sinh ra các thiết bị ngoại vi lôgic để tương tác

Một chu trình điển hình của các chương trình ứng dụng quản lý
các thiết bị ngoại vi được gọi là vòng lặp sự kiện từ thiết bị
(event-driven loop )

Mẫu tô (pattern).
45

Hệ thống đồ hoạ
(Graphics System)
„

Hệ thống đồ hoạ thông thường phải chứa một tập hợp các thủ tục

giữa người sử dụng và thiết bị ngoại vi này.

Màu sắc (color)
Kiểu đường vẽ (line style)
Kiểu văn bản (text style)
(c) SE/FIT/HUT 2003

„

image formats, compression, transfer


(chương trình con) để xử lý với các thiết bị vào ra (I/O System).

Các thuộc tính
ƒ

„

„

Điểm (pixel)
Đường thẳng (line)
Đường tròn (circle)

ƒ

(c) SE/FIT/HUT 2003

Bộ xử lý tương tác với người sử
dụng

Thành phần thư viện đồ hoạ
„

Image
Video

Graphics hardware

Giao diện hệ thống đồhọa

Interface of Graphics System

Interface between application software and graphics hardware system
Consists of input subroutines and output subroutines accepting input data or
commands from a user and converting internal representations into external
pictures on screen, respectively
Phần mềm đồ hoạ hệ thống:
„ Là tập hợp các lệnh đồ hoạ của hệ thống (graphics output commands),
„ Thực hiện cơng việc hiển thị cái gì (what object) và chúng sẽ được hiển thị như
thế nào (how).
„ Phần mềm đồ hoạ hệ thống là phần mềm xây dựng trên cơ sở một thể loại phần
cứng nhất định và phụ thuộc vào phần cứng.
Phần cứng đồ hoạ:
„ Là tập hợp các thiết bị điện tử (CPU, bộ nhớ màn hình) giúp cho việc thực hiện
các phần mềm đồ hoạ.
(c) SE/FIT/HUT 2003

46

(c) SE/FIT/HUT 2003

47

Core,
GKS, GKS-3D
CGI (device interface)
CGM (metafile)
PHIGS (3D and realtime)
X-window
PHIGS+ (PEX)

IGES
OpenGL
DirectX

Application program
Graphics system
Operating system
Input and
output devices

Graphics
hardware

(c) SE/FIT/HUT 2003

Metafiles

48

8


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

Non-official industry standards

Các chuẩn giao diện của hệ đồ hoạ
„


GKS (Graphics Kernel System):
„

„
„
„
„

„

„

GKS Functional Description, ANSI X3.124 - 1985.
GKS - 3D Functional Description, ISO Doc #8805:1988.

„

„

49

OpenGL
„
„
„

„

50


(c) SE/FIT/HUT 2003

DirectX

Software interface to graphics
hardware
Client-server model
250 distinct commands
Object specification + image
generation
Simple primitives: points, lines,
polygons (pixels, images, bitmaps)
3D rendering

„

Commands interpreted
using client-server model

„
„

„

Client (Application) issues
commands

„


Server (OpenGL) interprets
and processes commands

„

Frame buffer configuration
done by the window system

Direct control of graphics hardware
Direct control of input/output devices, and sound

Application
Applicationprogram
program

Windows
WindowsAPI
API

Direct sound
Direct input
Direct draw
Direct 3D

……..

Direct X

„


OPENGL SGI’s OpenGL 1993
DIRECTX Direct X/Direct3D 1997

CGI (Computer Graphics Interface System):
CGM (Computer Graphics Metafile):
VRML (Virtual Reality Modeling Language):
PHIGS (Programmers Hierarchical Interactive
„ PHIGS Functional Description, ANSI X3.144 - 1985.
„ PHIGS+ Functional Description, 1988, 1992.
IGES

(c) SE/FIT/HUT 2003

„

Các chuẩn của hệ đồ hoạ

Windows
Windowssystem
system
(c) SE/FIT/HUT 2003

51

Máy in
ƒ

ƒ

ƒ

„
„
„
„

„

Dot size: đường kính của một điểm in bé nhất mà máy
in có thể in được
Addressability: khả năng địa chỉ hố các điểm in có thể
có trên một đơn vị độ dài (dot per inch)
Số lượng màu có thể vẽ trên một điểm
Dot size
InkJet 8 - 20/ 100 inch
Laser 5/1000
inch
Máy vẽ 6 ÷ 15/1000 inch

52

Phần cứng đồ hoạ (Graphics
Hardware)

Các thiết bị vào ra dữ liệu
„

(c) SE/FIT/HUT 2003

Các thành phần phần cứng của hệ đồ hoạ tương
tác


Point per inch
200 ÷600
1500
1000 ÷ 2000

(c) SE/FIT/HUT 2003

53

(c) SE/FIT/HUT 2003

54

9


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

Màn hình CRT

Màn hình CRT

Standard Dot-trio

SONY Trinitron CRT

Hitachi EDP


NEC Hybrid Mask
55

(c) SE/FIT/HUT 2003

Các thiết bị hiển thị dạng vector
„
„
„
„

MOVE
LINE
LINE
Refesh

10,15
400,300
600,800
Buffer

Turn
move
Turn
move

beam off,
to A.
beam on,

to B.

Graphics Devices


MOVE
10
15
LINE
100
25
CHAR
LU
CY
LINE


JMP

B

DrawLine(A, B):

A

Refresh buffer memory
57

(c) SE/FIT/HUT 2003


Typical raster graphics display
showing a house and a star

00000000000000000000000001000000
00000000000000000000000001000000
00000000000000000000000111110000
00000000011000000001111111111111
00000000111100000000000111110000
00000011111111000000000001000000
00001111111111110000000001000000
00111111111111111100000000000000
00011111111111111000000000000000
00011111111111111000000000000000
00011111111111111000000000000000
00000000000000000000000000000000

Interface to
host computer

(Display commands)

Display
processor

(interaction data)

CRT
Stylus

Alphanumeric keyboard


Data tablet

(c) SE/FIT/HUT 2003

58

Các thiết bị hiển thị dạng điểm

Interface to host computer

(Display commands)

56

(c) SE/FIT/HUT 2003

(interaction data)

Display
processor

Keyboard
Data input

CRT

Bitmap refresh buffer
(the 1’s are accentuated
for contrast)

(c) SE/FIT/HUT 2003

59

(c) SE/FIT/HUT 2003

60

10


Khoa CNTT - ĐHBK Hà nội
Email:
Tel: 0913030731

LCD-Liquid Crystal Display
„
„

„
„
„

CRT Displays

A transmissive technology
Works by letting varying
amounts of a fixed-intensity
white backlight through an
active filter

Organnic crystals that lign
themselves together
When external force is applied
they realign themselves
This is used to change
polarisation and filter light

Advantages
„ Fast repsonse (high
resolution possible)
„ Full color (large modulation
depth of E-beam)
„ Saturated and natural colors
„ Inexpensive, matured
technology
„ Wide angle, high contrast
and brightness

(c) SE/FIT/HUT 2003

61

(c) SE/FIT/HUT 2003

„
„
„
„
„
„

„
„

Disadvantages

Small footprint (approx 1/6 of CRT)
Light weight (typ. 1/5 of CRT)
Low power consumption (typ. 1/4 of
CRT)
Completely flat screen - no
geometrical errors
Crisp pictures - digital and uniform
colors
No electromagnetic emission
Fully digital signal processing
possible
Large screens (>20 inch) on desktops

62

Future Research Areas
Hướng nghiên cứu

LCD Displays
Advantages

Disadvantages
„ Large and heavy (typ. 70x70
cm, 15 kg)
„ High power consumption (typ.

140W)
„ Harmful DC and AC electric
and magnetic fields
„ Flickering at 50-80 Hz (no
memory effect)
„ Geometrical errors at edges

„
„
„
„

High price (presently 3x CRT)
Poor viewing angle (typ. +/- 50
degrees)
Low contrast and luminance (typ.
1:100)
Low luminance (typ. 200 cd/m2)

(c) SE/FIT/HUT 2003

„

„

„

„

„


Rendering
„
„

physically-based
modeling
level of detail

„
„

Motion control /
synthesis
„

63

parallel processing

Geometric modeling
„

„

„

Graphics accelerators

kinematics / dynamics

motion capture/
modification

„
„
„

photo-realism
real-time
image-based rendering
non-photorealistic
rendering

Scientific visualization
Geometric algorithms
User interface

(c) SE/FIT/HUT 2003

64

11



×