Java 1.5 : principales nouveautés
17 pages
Français

Java 1.5 : principales nouveautés

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
17 pages
Français
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

Java 1.5 : principales nouveautés classes paramétrées : generics encapsulation des valeurs de types primitifs : auto[un]boxing itération sur les boucles types énumérés nombre d'arguments variable des méthodes : varargs java.sun.com/developer/technicalArticles/releases/j2se15langfeat/ Cours 6 - TEP - UPMC - 2008/2009 – p. 1/34
  • statique générique
  • langage des bibliothèques de la machine abstraite
  • classe paramétrée
  • bibliothèques antérieurs
  • arraylist
  • arraylist hierarchie de classes
  • symbol symbol
  • ud
  • java

Sujets

Informations

Publié par
Nombre de lectures 54
Langue Français

Extrait

Alternative au lancer de rayons
• Le pipeline
graphique !
• Plus mécanique et
Synthèse d‘Images
automatisable
Elmar Eisemann • Motivation pour
apprendre les Elmar.Eisemann@inrialpes.fr
transformations!
Basé sur les cours de
Frédo Durand, Barbara Cuttler, E. Boyer,
H. Briceno, N. Holzschuch, Alex Meyer http://deptinfo.cnam.fr/Enseignement/CycleSpecialisation/CAM/sicam6.pdf
Pourquoi?
Alternative au lancer de rayons
Hardware optimisé:
• Au lieu de lancer un Ray tracing: Graphics Hardware:
rayon on projecte le CPU Capable de faire
triangle sur le plan certains calculs très
image vite
Par exemple:
Gouraud shading
Pourquoi? Pourquoi?
Complexité: Repère locales
Ray tracing: Graphics Pipeline: Ray tracing: Graphics Pipeline:
Complexité: m*n Complexité: k+n Changer le rayon Automatique
Avec accélération: Où
Environ m*log(n) k= nombre de pixels
déssinéOù
n= nombre de trianglesm= nombre de pixels
n= nombre de triangles
O
http://deptinfo.cnam.fr/Enseignement/CycleSpecialisation/CAM/sicam6.pdf
1Pourquoi?
Le pipeline graphique
Interpolation d‘information
Object TransformationRay tracing: Graphics Pipeline:
À chaque point recalcué Interpolation directe Viewing Transformation
(Perspective / Orthographic)
Illumination
(Shading)
Clipping
Projection
(to Screen Space)
Scan Conversion
(Rasterization)
Display
Le pipeline graphique Le pipeline graphique
Object Transformation Object Transformation
Viewing Transformation Viewing Transformation
(Perspective / Orthographic) (Perspective / Orthographic)
Illumination Illumination
(Shading) (Shading)
Clipping Clipping
Projection Projection
(to Screen Space) (to Screen Space)
Scan Conversion Scan Conversion
(Rasterization) (Rasterization)
Display Display
Le pipeline graphique Le pipeline graphique
Object Transformation Object Transformation
Viewing Transformation Viewing Transformation
(Perspective / Orthographic) (Perspective / Orthographic)
Illumination Illumination
(Shading) (Shading)
Clipping Clipping
Projection Projection
(to Screen Space) (to Screen Space)
Scan Conversion Scan Conversion
(Rasterization) (Rasterization)
Display Display
2Le pipeline graphique Le pipeline graphique
Object Transformation Object Transformation
Viewing Transformation Viewing Transformation
(Perspective / Orthographic) (Perspective / Orthographic)
Illumination Illumination
(Shading) (Shading)
Clipping Clipping
Projection Projection
(to Screen Space) (to Screen Space)
Scan Conversion Scan Conversion
(Rasterization) (Rasterization)
Display Display
Le pipeline graphique Systèmes Coordonnées
World space Object space
• Rapide: Toujours les mêmes operations Object Transformation
(repère monde) (repère objet)
• Pas de ray-tracing! Eye/Camera Viewing Transformation
(Perspective / Orthographic) Space
(Changement des coordonnées)
(repère camera)
Clip SpaceClipping
Projection Screen Space
(to Screen Space)
(repère image)
Plan Système de coordonnées
World space Object space
•Transformations géométriques Object Transformation
(repère monde) (repère objet)
•Projections, caméra, perspective Viewing Transformation Eye Space /
(Perspective / Orthographic)
Camera •Élimination des parties cachées
Illumination Space
(Shading)
(repère camera)
Clipping Clip Space (NDC)
Projection
(to Screen Space)
Scan Conversion
Screen Space
(Rasterization)
(repère image)
Visibility / Display
3Préliminaires Co-ordinate Systems
YY
XX
ZZ
Right-Handed System Left-Handed System
(Z comes out of the screen) (Z goes in to the screen)
Points, P (x, y, z) Vecteurs, V (x, y, z)
• Position relative à l’origine du système • direction en 3D
de coordonnées
• Points != Vecteurs
– Point – Point = Vecteur
– Vector+Vecteur = Vecteur
– Point + Vecteur = Point
– Point + Point = ?
Vectors VVecteurs, V (x, y, z)
• Norme d’un vecteur V (x, y, z)
– |V| =
w
2 2 2v x + y + z
2v v
(1/2)V v + w(-1)v
• A unit vector
addition
^multiplication scalaire (parallel) Vv + w =V
|V |
y
w P
v - w
v v
w
O x
difference
Vector OPv - w = v + (-w)
4Dot Product Cross Product
• a · b = |a| |b| cosθ
∴cosθ = a · b/ |a| |b|
• Résultat est un vecteur ortho
• a · b = x ·x + y ·y + z ·za b a b a b • Calculé en utilisant les determinants
i j k i j k i j k i j k
x y z x y z x y z x y zv v v v v v v v v v v v
x y z x y z x y z x y zu u u u u u u u u u u u
– i(y z -z y ), -j(x z - z x ), k(x y - y x )v u v u v u v u v u v u
• | a x b | = |a||b|sinθ
• a x a = 0
Qu‘est-ce qu‘on veut
En 2 dimensions
représenter?
•On commence en 2D
– Plus facile à représenter
•Chaque point est transformé:
– x’ = f(x,y)
– y’ = g(x,y)
•Comment représenter la transformation ?
Translations Notation vectorielle
•Modification simple : •On utilise des vecteurs pour la
représentation• x’ = x+tx
– C’est plus simple• y’ = y+ty   x
•Un point est un vecteur :   y 
•Une translation est une somme
vectorielle : P’ = P + T
Avant Après
5Changement d’échelle Notation matricielle
•C’est une multiplication matricielle :
•Les coordonnées sont multipliées par P’ = SP
le facteur de changement d’échelle :
• x’ = s x
x
• y’ = s yy
s 0x   x ′   x
=       0 sy y ′    y
Avant Après
Changement d’affinité Notation matricielle
•Les coordonnées sont multipliées par le •C’est une multiplication matricielle :
facteur de changement d’échelle dans une
P’ = SHPautre coordonnée:
• x’ = x + sh yy
• y’ = y + sh xx
x′  1 sh  x   x
=    ′ sh 1y yy    
Avant Après
Rotation Notation matricielle
•Rotation = multiplication matricielle :
•Rotation en 2D : P’=RP
• x’ = cosθ x - sinθ y
• y’ = sinθ x + cosθ y
x cosθ − sinθ x ′     
=      y sinθ cosθ y ′     
θ
Avant Après
6Unification? Unification
•Notation simple, conciseP’ = P + T
•Mais pas vraiment unifiée
– Addition ou bien multiplication
x s 0 x ′    x – Comment faire pour concaténer plusieurs =       0 s transformations ?y y ′     y
•On veut une notation unique
– Qui permette de noter aussi les
′ 1 sh x   x combinaisons de transformationsx
=    sh 1y′ yy    
Coordonnées homogènes Coordonnées homogènes
• Deux points (x,y,w) et (x’,y’,w’) sont égaux si et
seulement si :
•Outil géométrique très puissant :
– x’/w’ = x/w et y’/w’= y/w
– Utilisé partout (Image, Vision, Robotique) – Mieux: Si exist a!=0 tq: a(x,y,w)=(x‘,y‘,w‘)
•On ajoute une troisième coordonnée, w • w=0: points « à l’infini »
•Un point 2D devient un vecteur à 3
coordonnées : W P x
 
y Plan W = 1 
  w  X
Y
Translations en c. homogènes Changement d’échelle
 x ′  s 0 0  x  x ′  1 0 t   x x ′ x x x ′ xx  = +t  =s      w w      w x w x′ ′ y ′ = 0 s 0 yy ′ = 0 1 t y yy               y yy ′ y ′       w ′   0 0 1 w        w ′  0 0 1  w = +t =s w  ww y w y′ ′
 x ′ =x + wt  x ′ =s x
x x 
 y ′ = y + wt  y ′ =s yy y
   w ′ = w  w ′ = w
7Composition des Rotation
transformations
•Les transf. rigide sont linéaires!
 x ′  c osθ − sinθ 0  x (et encore d’autres)
      y ′ = sinθ cosθ 0 y
x ′ y      x = cosθ − sinθw ′ w w      w ′   0 0 1 w   •Donc concatenation en multiplianty ′ yx= sinθ + cosθ w ′ w w
M = (Rot)(Trans)
 x ′ = cosθx − sinθy

 y ′ =sin θx + cosθy

w ′ = w
Rotation autour d’un point Q Et en 3 dimensions ?
•Rotation autour d’un point Q: •C’est pareil
– Translater Q à l’origine (T ), •On introduit une quatrième coordonnée, wQ
– Rotation autour de l’origine (R ) – Deux vecteurs sont égaux si : Θ
x  – Translater en retour vers Q (T ). x/w = x’/w’, y/w = y’/w’ et z/w=z’/w’-Q   y
 
 z
  w 
P’=(T )R T P-Q Θ Q •Toutes les transformations sont des matrices
4x4
Translations en 3D Changement d’échelle en 3D
1 0 0 t  s 0 0 0   x x
    0 s 0 00 1 0 t yy   S(s , s ,s ) =  x y zT(t ,t ,t ) =x y z 0 0 s 0  z 0 0 1 t  z   0 0 0 1     0 0 0 1
 x ′ =x + wt  x ′ =s xx x
   y ′ = y + wt  y ′ =s yy y
 
z = z + wt z = s z′ ′ z z 
  w = w w = w ′  ′
8Rotations en 3D Rotation autour x-axis
•Rotation = axe et angle
1 0 0 0 
  Axe x neAxe x ne0 cosθ − sinθ 0•Les rotations autour d’un axe de   Change pasR (θ) = Change pasx 0 sinθ cosθ 0  coordonnées ont une expression simple
 
 0 0 0 1 –

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents