• Keine Ergebnisse gefunden

Projektionen wie schon immer ...

N/A
N/A
Protected

Academic year: 2022

Aktie "Projektionen wie schon immer ..."

Copied!
21
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Projektionen

wie schon immer ...

Computergraphik

(2)

Bilderzeugung ?

Computergraphik Welt & Bildmodell

4

Graphics Pipeline

Modeling Transformations

Illumination (Shading) Viewing Transformation (Perspective / Orthographic)

Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

Output:

Farben / Intensitäten:

Angepasst an den Framebuffer und den Bildschirm (z.B. 24-bit RGB Werte) .

Input:

Geometrische Modelle:

Beschreibung aller Objekte, Oberflächen, Position der Lichtquellen.

Beleuchtungsmodell:

Rechenvorschriften zur Simulation der Interaktion von Materie und Licht Blickwinkel:

Kamera oder Augenposition,

"viewing frustum"

Raster Bereich

"Viewport", Pixelgrid in welches die Bildeben abgebildet wird

(3)

Modeling Transformations

3D Modelle haben eigenes Koordinatensystem (object space)

"Modeling transforms" orientieren die Modelle in einem gemeinsamen Koordinatensystem (world space)

Modeling Transformations

Illumination (Shading) Viewing Transformation (Perspective / Orthographic)

Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

Object space World space

Perspektivische Projektion 3D => 2D

(4)

Viewing Transformation

Abbildung der Weltkoordinaten in Kamerakoordinaten.

Blickrichtung wird i.a. in den Ursprung und entlang einer Koordinatenachse gewählt.

Modeling Transformations

Illumination (Shading) Viewing Transformation (Perspective / Orthographic)

Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

Eye space

World space

8

Betrachten dreidimensionaler Szenen

Ebene geometrische Projektionen: Der Wechsel von 3D Koordinaten zu 2D Bildschirmkoordinaten!

perspektivisch parallel

Der Unterschied zwischen parallel und perspektivischer Projektionen liegt im Abstand des Projektionszentrums (Augpunkt) zur Projektionsebene und zum Objekt.

(5)

Parameter einer 3D-Ansicht.

Bild-, Projektions-ebene (viewing plane VP )

Blickpunkt (view reference point VRP) Normale der Bildebene (viewing plane normal VPN) Abstand der Bildebene zum Augpunkt (viewing plane distance VPD) Oben Richtung (viewing up VUP)

Bildschirmmitte (center of window CW) Projektionsrichtung (direction of projection DOP)

Augpunkt (projection referenec point PRP)

Vordere und hinter Clippingebene (front and back plane FP BP)

10

Betrachten dreidimensionaler Szenen (3)

Die Parallel- als auch die perspektivische Projektion werden in viele Projektionstypen aufgespalten.

Parallelprojektionen Perspektivische Projektionen

Rechtwinklig:

Hauptriss

Axionometrische: iso-,di- tri-metrische

Schiefwinklig: Kavalier, Kabinett

1 Punkt , 2Punkt, 3Punkt

(6)

Homogene Koordinaten 2D

n.

beschreibe

Punkt selben

den

und obei w

,

y P x

h y x k h

y x h y x y

x

2D Kartesische Koordinaten ---> Homogene Koordinaten

12

Perspektivische Projektion

Projektion von 3D-Koordinaten zu 2D Bildschirmkoordinaten!

z z

x d z z

z x z

x

pz pz

pe pz p

z z y d z z

z y z

y

pz pz

pe pz p

z z

zpp e

(xp,yp,zpe)

z z

z z x x

pz pe pz p

Strahlensatz:

P= (x,y,z) Annahmen:

Augpunkt auf der z-Achse (0,0,zpz)

Projektions Ebene Projektionsebene z-Achse

Zpz Zpe

d = zpz- zpe

(7)

Perspektivische Projektion

Homogenen Koordinaten

1 1

h p

h p

perspektiv

h pe

x x x

y y y

h M

z z z

h

   

   

    

   

   

   

0 0 0

0 0 0

0 0

1 1

0 0 1

pz

p p pz

pe pz

pe

pe

pz pz

pz

pz pz

d

z z

x d x

z z

y y

z z

z z

z z z z z

z

z z z z

 

 

 

 

 

 

14

Perspektivische Projektion

Homogenen Koordinaten

1 0 0 0

0 1 0 0

mit 0 0

1 1

0 0

h

pz h pe pz

pe h

pz

x x

z z y z z y

h z

z z

d d d

h z

d d

   

   

   

       

1 1

h p

h p

perspektiv

h pe

x x x

y y y

h M

z z z

h

   

   

    

   

   

   

(8)

Perspektivische Projektion (Sonderfall 1 )





d z d

d z z d z M

pz pz pe pe per

0 1 0

0 0

0 0

1 0

0 0

0 1

Bisherige Annahmen: Augpunkt auf der z-Achse (0,0,zpz), Projektionsebene z-Achse

A) mit zpz= 0 und zpe = -d‘

per

1 0 0 0

0 1 0 0

M' 0 0 1 0

0 0 1 0

' d

 

' und

'

d d h z

d

16

Perspektivische Projektion

Projiziere alle Punkte entlang der z-Achseauf die z= dEbene, Augpunkt im Ursprung

x y z z / d

=

x y z 1 1

0 0 0

0 1 0 0

0 0 1 1/d

0 0 0 0 x · d / z

y · d / z d 1

=

homogenize

p

d x x

x z z d

p

d y y

y z z d

zp d

(9)

Perspektivische Projektion (Sonderfall 2 )





d z d

d z z d z M

pz pz pe pe per

0 1 0

0 0

0 0

1 0

0 0

0 1

Bisherige Annahmen: Augpunkt auf der z-Achse (0,0,zpz),

B) mit zpz= -d‘ und zpe = 0

per

1 0 0 0

0 1 0 0

M' 0 0 0 0

0 0 1 1

' d

 

' '

und '

d

z h d d

d

Projektionsebene z-Achse

18

Grenzübergang, d → ∞

1 0 0 0

0 1 0 0

0 0 0 1/d

0 0 0 1

1 0 0 0

0 1 0 0

0 0 0 0

0 0 0 1

...ist eine

orthographische Projektion diese perspektivische

Projektionsmatrix...

(10)

Perspektivische Projektion (allgemein)

 

mit (0, 0, ) ( , , )

folgt für einen Punkt ' ( ', ', ') auf .

' ' '

pe x y z

x x

y y

pe z pe z

PZ z Q d d d

P x y z S

x Qd x Qd

y Qd t y Qd

z z Qd z z Qd

 

       

löse die Gleichungen für ' nach , ' und '

pe p

p p

z z z

t x x y y

( ), 0 1

P Zt PP Z  t

Ppliegt auf der Strecke Szwischen PZund P

P= (x,y,z) Annahmen:

Augpunkt auf der z-Achse (0,0,zpz)

Projektions- Ebene

Pp=(xp,yp,zpe)

(0,0,zpe) PZ

Projektionsebene z-Achse

Q (dx,dy,dz) PZ

20

Perspektivische Projektion (allgemein)

 

' (1)

' (2)

' (3)

x x

y y

p z p z

x Qd x Qd

y Qd t y Qd

z z Qd z z Qd

 

  

     

      

     

    

      P= (x,y,z)

Projektions- Ebene

Pp=(xp,yp,zp)

(0,0,zp) Q

(dx,dy,dz) PZ

z 1

) 2 ( in ) 3 (

p

z

z y p z y p

Qd z

d z d d z d y y

 

 

für ' (3)

p

p p z

p z

z z

z z Qd

t z z Qd

 

   

, z 1

(1) in ) 3 (

p

z

z x p z x p

Qd z

d z d d zd x x

(11)

Perspektivische Projektion (allgemein)

z 1

p

z

z y p z y p

Qd z

d z d d zd y y

, z 1

p

z

z x p z x p

Qd z

d z d d zd x x

p

p

z 1

z

z 1

z

p p

z

z z Qd

z Qd

 

 

p

p

z 1

z

z 1

z

p p

z

z z Qd

z Qd

 

 

per ?

M

z 1 h 1

p

Qdz

z

2

1 0

0 1

0 0

0 0 1 1

x x

p

z z

y

p

z z

per

p p

p

z z

p

z z

d d

d z d

d dy

d z d

M z z

Qd Qd z z

Qd Qd

 

2

1 0

0 1

0 0

0 0 1 1

x x

p

z z

y

p

z z

p p

p

z z

p

z z

d d

d z d

d dy

d z d

z z

Qd Qd z z

Qd Qd

22

Perspektivische Projektion (allgemein)

1 1 0 0

0 0

1 0

0 1

allgemein 2

z p z

p z p z

p

z y p z

y

z x p z

x

Qd z Qd

Qd z z Qd

z

d z d d

d

d z d d

d

M

Zp Q [ dx dy dz ]

0 0 -1

0

o r t

M

0 0 -1

d d

p e r

M

0 0 -1

d 0 'p e r M

(12)

Parallel Projektion

1 1 0 0

0 0

1 0

0 1

allgemein 2

z p z

p z p z

p

z y p z

y

z x p z

x

Qd z Qd

Qd z z Qd

z

d z d d

d

d z d d

d

M

Zp Q [ dx dy dz ]

c o s s in -1

0

C a v a lie r

1 - 2 s in 2 cos 0





Cabinet

24

Was ist falls p

z

Auge

z

ist ?

(eyex, eyey, eyez)

image plane z axis

(13)

Was ist falls p

z

Auge

z

ist ?

(eyex, eyey, eyez)

image plane z axis

26

Was ist falls p

z

Auge

z

ist ?

(eyex, eyey, eyez)

image plane z axis

(14)

Was ist falls p

z

Auge

z

ist ?

(eyex, eyey, eyez)

image plane z axis

???

28

Was ist falls p

z

Auge

z

ist ?

(eyex, eyey, eyez)

image plane z axis

Ausweg: beschränken der Geometrie auf das " view

frustum"

(15)

Projektionen der "pipeline"?

Modeling Transformations

Illumination (Shading) Viewing Transformation (Perspective / Orthographic)

Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

Camera /eye Space

Normalized Device Coordiantes

Screen Space

30

Normalizing the Viewing Volume

2 0 0 0

2

0 0 0

2

0 0 0

0 0 0 1

1 0 0

0 1 0

0 0 1

0 0 0 1

2 2

2

1 1

normalized normalized normalized

r l

t b

n f

l r b t

n f

x x

y y

z z

 

 

   

   

   

   

   

   

 

Orthographic viewing volume:

x = l:=left plane x = r:=right plane y = b :=bottom plane y = t:= top plane z = n:=near plane z = f:= far plane

(16)

Orthographic Projection

 

1 1 1

pixel normalized

pixel normalized

sreeen o

normalized normalized

x x x

y y y

M M

z z z

 

 

 

 

 

 

2 0 0 0

0 2 0 0

0 0 2 0

0 0 0 1

1 0 0

0 1 0

0 0 1

0 0 0 1

2 2 2

1 1

pixel pixel

screen normalized

r l

r b

r f

l r b t n f

x x

y y

z M z

 

 

   

   

   

   

   

   

 

2 0 0 0

0 0

2 2

0 2 0 0

0 0

2 2

2

0 0 0

0 0 1 0

0 0 0 1

0 0 0 1

1 1 0 0

1 0 1 0

0 0 1

0 0 0 1

2 2 2

1 1

x x

pixel

y y

pixel normalized

n n

r l

n n

r b

r f

l r b t n f

x x

y y

z z

 

   

   

   

   

   

   

      

32

Viewing Transformation

Welt Koordinaten → Kamera koordinaten

Positionieren der Kamera

Translation + Änderung der orthonormal Basis Gegeben:

Koordinatenxyz& uvn, und der Punkt p= (x,y,z) Finde:

p= (u,v,w) x

y v

u x p

y u

v

- w

(17)

Viewing Transformation

Positionieren der Kamera

Gegeben:

Koordinatenxyz& uvw, e und der Punkt p= (x,y,z) Finde:

p= (u,v,w)

v

0 1 0 0

0 0 1 0

M

0 0 0 1

0 0 0 1 0 0 0 1 1

x y z x

x y z y

x y z z

u u u e x

v v v e y

w w w e z

    

    

    

    

    

    

34

Full orthoraphic projection pipeline

compute: Mv

compute: Mo M = Mo Mv

Foreach line segment ( ai, bi ) do p = M ai

q = M bi

draw line (xp, yp, xq, yq)

(18)

Perspective Projection

 

'

'

'

1

P

h x x

h y y

h z M z

h

 

 

 

 

 

 

P

1 0 0 0

0 1 0 0

0 0

0 0 1 0

n f

M f

n n

36

Full perspective projection pipeline

compute: Mv compute: Mo compute: MP

M = Mo MPMv

Foreach line segment ( ai, bi ) do p = M ai

q = M bi

draw-line ( xp/hp, yp/hp, xq/hq, yq/hq)

Mo MP is often called theprojection matrix

(19)

The openGL projection Matix

Mo MP is often called theprojection matrix

openGL

2

2

2

0 0

0 0

M

0 0

0 0 1 0

n r l

r l r l

n t b

t b t b

f n fn

f n f n

38

Graphics Pipeline

Effizientes Clipping wird NICHT in einem einzelne Prozessschritt durchgeführt!

Modeling Transformations

Illumination (Shading) Viewing Transformation (Perspective / Orthographic)

Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

(20)

Full Clipping

(eyex, eyey, eyez)

image plane z axis

"clip" geometry to view frustum

40

Front- & Backplane clipping

(eyex, eyey, eyez)

image plane z axis

"clip" geometry to near plane

(21)

Tiefenspeicher ( z-buffer algorithm 1974 )

Für jeden Rasterpunkt x,ywird zusätzlich, außer dem BildspeicherB(x,y) der die Farbintensitäten i speichert, noch ein Tiefenspeicher T(x,y)für z(x,y)angelegt (16 - 32 bit).

1.) Initialisieren: für alle x,y

B(x,y)= Hintergrundfarbe

T(x,y)= Zmax (maximal vom Beobachter entfernt).

2.) Alle Objekte rendern ( rastern, scanline-konvertieren) z(x,y)berechnen;

nur falls z(x,y) < T(x,y)

==> T(x,y)= z(x,y) und B(x,y)= i (x,y)

Wolfgang Strasser, in seiner Habilitationschrift (1974) erster Hinweis auf Z-buffer Methodik.

Referenzen

ÄHNLICHE DOKUMENTE

Bei der Anzeige von Geodaten gilt es oftmals der Fülle an Daten Herr zu werden. Der gesamte Datenbestand, welcher oftmals so groß ist, dass dieser in einer Datenbank ge-

Active measurements on the data plane send packets from end host(s) to other host(s). It involves the network, transport, and usually the

&#34;Führt die verstärkte Nutzung der Visuellen Medien zu einer größeren visuellen Intelligenz der Betrachter oder werden sie nur effektiver manipuliert?&#34; - Diese Frage stellte

Wer das Finale der Fußballweltmeisterschaft lieber in der Gemeinschaft schauen möchte, ist im Stadtteil West genau richtig.. Das Soziale Stadt Büro Bürgertreff West veranstaltet auf

Etant donné trois points colinéaires, l’un d’entre eux au plus est situé entre les deux autres2. (Axiome de Pasch.) Soit a, b, c trois points non colinéaires et D une droite ne

(3) We begin with the simple case of the Klein-Gordon particles (without spin) to determine the Green func- tion, and then we pass to the Green function for the Dirac equation

Uedem: Vortrag über Social Networ- king - facebook und co. um 19 Uhr in der hanns-Dieter-hüsch-Schule. Uedem: Abendgebet in den Fasten- wochen um 19.30 Uhr in der St. Lau-

Wie groß ein „normaler“ Abstand bei den unterschiedlichen Beziehungen ist, lässt sich sogar relativ genau beziffern: Während im öffentlichen Raum ein Abstand von mehr als