SlideShare a Scribd company logo
1 of 46
Download to read offline
3D Viewing
                            Chen Jing-Fung (2006/12/1)
                             Assistant Research Fellow,
                                Digital Media Center,
                          National Taiwan Normal University



                                       Video Processing Lab
                                             臺灣師範大學數位媒體中心視訊處理研究室

Ch7: Computer Graphics with OpenGL 3th, Hearn Baker
Ch5: Interactive Computer Graphics 3th, Addison Wesley
3D viewing framework
• How to view 3D

• Some kind types of 3D projections

• How to do 3D views



                       Video Processing Lab   2
                          臺灣師範大學數位媒體中心視訊處理研究室
3D viewing device
• Virtual-Reality System-Amsterdam




                         R.G. Belleman, PhD, (application at the company of Sara)
                                                                             3
                                             Video Processing Lab
http://www.science.uva.nl/research/scs/projects/visualisation/index.php?page=hardware
                                               臺灣師範大學數位媒體中心視訊處理研究室
How to make it ?




          Video Processing Lab   4
             臺灣師範大學數位媒體中心視訊處理研究室
2D -> 3D
• 2D graphics application and viewing
                                                          2D view
  operations transfer positions                           no parallax
  – The world-coordinate plane -> pixel
    positions output plane
  – Rectangular boundaries for clipping window
     • Clip a scene and maps it to device coordinate
                                                                 monitor
• 3D viewing (more choices than 2D)
  – How to construct a scene
  – How to generate views it on output device



                                   Video Processing Lab                 5
                                      臺灣師範大學數位媒體中心視訊處理研究室
Two eyes game
    • Two eyes = two separate
      vision angle
         – Close one eye
         – Put your free finger to aim
           “bowling”
         – Switch to close another
           eye
                  Two eyes vision angle is same?


                                          Video Processing Lab   6
http://www.vision3d.com/stereo.html          臺灣師範大學數位媒體中心視訊處理研究室
How to see 3D?
    • Two eyes can see 3D
         – Two images be
           captured by two eyes
         – Images arrive
           simultaneously in the
           back of the brain
         – They are united into
           one picture                                             brain

                    A key point of 3D view is depth !!
                  an object’s solid in three spatial dimensions:
                   width, height and depth -- x, y and z.
                                           Video Processing Lab            7
http://www.vision3d.com/stereo.html           臺灣師範大學數位媒體中心視訊處理研究室
Overview 3D viewing
        concepts
• Object in 3D scene
  – A set of surfaces (object descriptions)
    • Generate views of an object’s surface
      features
  – Closed boundary around the object
    • Provide routines
       – displaying internal components
       – Cross-sectional views of a solid object



                              Video Processing Lab   8
                                 臺灣師範大學數位媒體中心視訊處理研究室
Viewing 3D scene
• Set up a coordinate reference for
  the viewing - “camera” parameters
  – The coordinate reference defines
    • Position and orientation for a view plane or
      projection plane
  – Object descriptions
    • Transferred to viewing coordinates
    • Projected onto the view plane



                          Video Processing Lab       9
                             臺灣師範大學數位媒體中心視訊處理研究室
3D viewing process


             Clipping           Project to            Viewport
             process          projection plane     transformation

Object                                                          Output
                        Clipping
(scene) -                                                       device -
                        (Camera) -
coordinate                                                      coordinate
                        coordinate




                                        Video Processing Lab          10
                                           臺灣師範大學數位媒體中心視訊處理研究室
Classical views



Front elevation   Elevation oblique          Plan oblique




                  One-point perspective    Three-point perspective
     isometric
                               Video Processing Lab           11
                                  臺灣師範大學數位媒體中心視訊處理研究室
Three projections

•   Introduction projection & views
•   Axonometric projections
•   Oblique projections
•   Perspective projections




                       Video Processing Lab   12
                          臺灣師範大學數位媒體中心視訊處理研究室
Parallel-projection views
• Orthographic projection:
  show accurate dimensions
  – Used in engineering and
    architectural
                        side                   front
     top




                               Video Processing Lab    13
                                  臺灣師範大學數位媒體中心視訊處理研究室
multi-view orthographic
                                      Plan view
• projection plane is                 (top view)

  parallel to one of the
  object’s principal faces.
• display at least three
  views- such as the
  front, top and right
                                                   side view
                     front view                    (right view)




                      Video Processing Lab               14
                         臺灣師範大學數位媒體中心視訊處理研究室
Axonometric projections
• Preserve how many views direct by original
  object **projected lines is parallel but angles are not
       • Foreshortening: an object appears compressed plane
         (projected) which extracted by a particular viewpoint
• Dimetric view
       • Two different foreshortening ratios
• Trimetric view (general case)
       • Three different foreshortening ratios
• Isometric view
       • Symmetrical projection of three principal directions
            Q: Symmetrical two principal faces?

                                  Video Processing Lab           15
                                     臺灣師範大學數位媒體中心視訊處理研究室
Projected vs. original
•   Lines are scaled and can find scale ratios
•   Angles are not related
                    projected
•
•   View box-like object on projection plane
•   Not look real:
    – No matter how objectproj is near or far, it has
      the same projection
           axonometric views are used extensively in
           architectural and mechanical design


                                   Video Processing Lab   16
                                      臺灣師範大學數位媒體中心視訊處理研究室
Clipping window projection
• Orthogonal-projection view
  volume (view plane)                                                      Clipping
                                                                           window
  – 2D rectangular clipping                   Far plane
    window -> 3D near-far                                       Near
                                                                plane
    clipping planes (box-like)
                                                        Normalized view volume
                    Orthogonal-projection
          yview                       (xwmax,ywmax,zfar) ynorm    znorm
                    view volume
                                                                 (1,1,1)
  zview     xview
                                         Project                   xnorm
           (xwmin,ywmin,znear)                     (-1,-1,-1)

           glMatrixMode (GL_PROJECTION)
           glLoadIdentity()
           glOrtho(xwmin,xwmax,ywmin,ywmax,znear,zfar)
                                       Video Processing Lab                 17
                                           臺灣師範大學數位媒體中心視訊處理研究室
Real case about
Axonometric projections
• Technically some games (strategy
  or simulation) use this projection
  to show object’s distance whether
  near or far




                     Video Processing Lab   18
                        臺灣師範大學數位媒體中心視訊處理研究室
Oblique projections

• Oblique views are the most general
  views
  – Can make an arbitrary angle with
    projection plane
    • Angles can be preserved
       –            projected

    • The most difficult to construct by hand
    • Bellows camera is flexible to produce
      approximations to parallel oblique views
           **Oblique view are somewhat unnatural.

                                Video Processing Lab   19
                                   臺灣師範大學數位媒體中心視訊處理研究室
Clipping –
       Oblique projections
• CG-Oblique projections
  – Objectworld -> objectrotate -> objectproj
  Clipping window                                   Clipping window
                              View plane

                      Near plane
                                                    Transformed
                                                    Oblique view volume
                                Shear
        View volume
  Vp                        transformation


                          Far plane
         Oblique-projection
         view volume        Moblique,norm=Mortho,norm * Moblique

                                      Video Processing Lab                20
                                          臺灣師範大學數位媒體中心視訊處理研究室
Orthogonal projection
               vectors
    • DOP = -VPN                      VUP:
                                      view-up vector to this plane


                                        View plane
    DOP:
    projection’s direction
                             VPN:
                             view-plane normal   VPN: view-plane normal

    • Vector u & v in plane A                                  v
                                            Plane A
         – viewPN=uxv/det|uv|                             u



                                   Video Processing Lab              21
http://www.cmlab.csie.ntu.edu.tw/~robin/courses/
                                             臺灣師範大學數位媒體中心視訊處理研究室
Projection tunnel

   Clipping window         projection plane    view plane


Any point            DOP                              VRP
                CW   ∞
                                    PRP       VPN
  (umin,vmin)
                     (umav,vmax)




                                        Video Processing Lab   22
                                           臺灣師範大學數位媒體中心視訊處理研究室
Orthogonal projection -
             Oblique
           Clipping
           window                  View
                         Near      plane             Transformed
               Oblique-
                                                     Oblique view
               projection view
                                       Shear         volume
          Vp   volume

                                 Far
           • Translate the VRPclip to the origin
           • Rotate VRC to projected plane (PRP)
           • Shear that let the DOP become parallel to the
             projected plane (PRPshear)
           • Translate and scale into the parallel-projection
             normal view volume
                        No =Sp_prp Tp_prp SHprp Rvrc T(VRP)
                                               Video Processing Lab   23
http://www.cmlab.csie.ntu.edu.tw/~robin/courses/
                                             臺灣師範大學數位媒體中心視訊處理研究室
Perspective projections

                                               monitor




                                                 Video Processing Lab 24
http://groups.csail.mit.edu/graphics/classes/6.837/F04/calendar.html
                                                    臺灣師範大學數位媒體中心視訊處理研究室
Projection tunnel

                                                   view plane
                         projection plane
                                                VRP
      Clipping window

                                      PRP    VPN
                        COP


COP




                                    Video Processing Lab        25
                                       臺灣師範大學數位媒體中心視訊處理研究室
Depth cueing
• Depth information is important in 3D
  scene
    – Easy identify the particular viewing
      direction
        • The front and back of each displayed object
No depth information   Downward from above   Upward from below base
                       vertex




                                  Video Processing Lab          26
                                     臺灣師範大學數位媒體中心視訊處理研究室
Perspective-projection
     view volume

                                           Rectangular
                    view                   Frustum
                    window                 view volume
  Projection
  reference
  point
                    θ    (xprp,yprp,zvp)
 (xprp,yprp,zprp)                     Near clipping Far clipping
                                      plane         plane




                                     Video Processing Lab          27
                                           臺灣師範大學數位媒體中心視訊處理研究室
OpenGL Perspective-
Projection (p.p) Function
                                                     θ/2

• Symmetric p.p function                                    View plane


   gluPerspective(theta, aspect, dnear, dfar)        zprp-zvp

     • Four parameters: double or float point
     • Theta (field-of-view angle): angle between
       top and bottom
     • Aspect ratio: (width/height)
     • dnear & dfar: negative, because clipping plane
       must always be somehow along the –zview axis
       (behind the view position)


                                    Video Processing Lab            28
                                       臺灣師範大學數位媒體中心視訊處理研究室
Aspect ratio
(width)x (height)
   Sony PSP 4.3”        ST-International 19”

                                                Panasonic 42 ”


    80mmx15mm




                    500mmx485mm
                    ~1:1


                                         16:9

                                     Video Processing Lab        29
                                        臺灣師範大學數位媒體中心視訊處理研究室
OpenGL p.p function (2)
                                                           Frustum
                                                           view
                                                           volume
• General p.p function
gluFrustum(xwmin, xwmax, ywmin, ywmax, zwnear, zwfar)
                                                        Near plane Far plane
        • All parameters: double or float point
          numbers
        • zwnear & zwfar : negative (behind the view
          position) as tha same as dnear & dfar
        • Clipping window can be specified anywhere
          on the near plane.
            – Xwmin = -xwmax & ywmin = -ywmax



                                       Video Processing Lab             30
                                          臺灣師範大學數位媒體中心視訊處理研究室
3D viewing process


             Clipping           Project to            Viewport
             process          projection plane     transformation

Object                                                          Output
                        Clipping
(scene) -                                                       device -
                        (Camera) -
coordinate                                                      coordinate
                        coordinate




                                        Video Processing Lab          31
                                           臺灣師範大學數位媒體中心視訊處理研究室
3D scene process by CG
• Choose a viewing position
  (camera)
  – Point to where camera
    (camera position)
• Choose a viewing position
  (object)
  – Display a front, back, side,
    top, or bottom view


                        Video Processing Lab   32
                           臺灣師範大學數位媒體中心視訊處理研究室
Synthetic camera
• First, pick a position (object
  fixed)                                              COP
  – Middle of a group of objects
  – Inside a single object
• Camera located in COP
  – Focus on camera’s motion
  – Rotate it
  – Choose a parallel or
    perspective projection
     • Eliminate parts of a scene along
       the line of sight


                               Video Processing Lab         33
                                  臺灣師範大學數位媒體中心視訊處理研究室
Projections (views)
      Perspective projection (views):
      •center of projection (COP)        Parallel projection (views):
      •More realistic like               •Direction of projection (DOP)
      our eyes and camera lens
      •View space: near & far
                                  object                projector     object
                      projector

        Projection plane


finite COP
                              infinite COP
                                                 Projection plane


                              **depth!!

                                             Video Processing Lab        34
                                                臺灣師範大學數位媒體中心視訊處理研究室
One-point perspective
                 view




                                       Video Processing Lab         35
http://www.richardmurphyarchitects.com/projects/images 臺灣師範大學數位媒體中心視訊處理研究室
Two-point perspective
                views




                                            Video Processing Lab 36
http://www.cityofmoorhead.com/whats_new/downtown/Perspective.jpg
                                               臺灣師範大學數位媒體中心視訊處理研究室
Three-points views




                                                   37
The Music Lesson, c.1662-1665
                            Video Processing Lab
                               臺灣師範大學數位媒體中心視訊處理研究室
Multi-perspective views

• Advantage
  – Objects can display multi-view and show
    the relation about near and far
    • Look realistic
• Disadvantage
  – Object has not parallel lines
  – Difficult by hand ( easy by computer
    design)


                       Video Processing Lab   38
                          臺灣師範大學數位媒體中心視訊處理研究室
Positioning of the camera
          frame
• Camera can be move by designer
  – Follow the rotation steps                 COP
    •   glMatrixMode(GL_MODELVIEW)
    •   glLoadIdentity()
    •   glTranslatef()
    •   glRotatef()
    •   ….




                       Video Processing Lab         39
                          臺灣師範大學數位媒體中心視訊處理研究室
VPN       VUP

                                            VRP         v
 Two viewing APIs                                   u

                                              Camera frame
• Only one view direction is a little
  unsatisfying
  – Starting points in the world frame
     • Describe the camera’s position and orientation in this
     • glLoadIdentity() -> set_view_reference_point(x,y,z)
     • The orientation of the camera divide two parts
        – VPN: set_view_plane_normal (xn, yn, zn)
        – VUP: set_view_up(xvup, yvup,zvup)
     • Do transformation operators




                                Video Processing Lab            40
                                   臺灣師範大學數位媒體中心視訊處理研究室
Look-at function
                                       • A more direct method is
                                         appropriate the camera
         (xref, yref, zref)           gluLookAt(xeye, yeye, zeye, xref, yref, zref, xup, yup, zup)
(xup, yup, zup)
                                                 • (xeye, yeye, zeye) = world-
                                                   coordinate position P0 Ex: (0,0,0)
  camera
                 (xeye, yeye, zeye)              • VUP= (xup, yup, zup) Ex: y-axis
                                                   (0,1,0)
                  monitor                        • VRP=(xref, yref, zref) = projection
                                                   position Pref Ex: (0,0,-1)
                                                 • VPN=P0-Pref
                                          **viewing direction is along to any axis
                                          (maybe z-axis or –z-axis)

                                                         Video Processing Lab                   41
                                                            臺灣師範大學數位媒體中心視訊處理研究室
Set up a typical camera

• Cameras are often set to “look down”
  on a scene from some nearby position
    • Ex: eye=(4,4,4), look=(0,1,0), upward
      up=(0,1,0), view volume width=6.4 &
      height=4.8 (aspect ratio = 640/480), near =1
      & far =50         glMatixMode(GL_PROJECTION);//set the view volume
                         y
                               glLoadIdentity();
                     look at   glOrtho(-3.2,3.2,-2.4,2.4, 1,50);//or use Frustumview volume
              z
                               glMatrixMode(GL_MODELVIEW);//place and aim the
                               camera
                               glLoadIdentity();
                               gluLookAt(4,4,4,0,1,0,0,1,0);
        x

                                       Video Processing Lab                        42
                                           臺灣師範大學數位媒體中心視訊處理研究室
What does gluLookAt()
         do?
• gluLookAt() builds a matrix (V) that
  converts world coordinates into eye
  coordinates (eyeu,v,n). n = eye-look
          up                          u = upxn
                 v                    v = nxu
      n
  u                         gluLookAt()  ux     uy    uz   dx 
           eye              matrix                            
                                     V vx      vy    vz   dy 
                                         nx     ny    nz   dz 
                                                              
                                        0       0     0    1
                     look
                            (dx,dy,dz)=(-eye·unor, -eye·vnor, -eye·nnor)

                               Video Processing Lab                 43
                                  臺灣師範大學數位媒體中心視訊處理研究室
Inquiring about values in
   a matrix in OpenGL
• gluLookAt(4,4,4,0,1,0,0,1,0);
   – Eye: (4,4,4), look: (0,1,0), up: (0,1,0)
                  n = eye-look              ux   uy   uz   dx 
                  u = upxn                                    
                                             v    vy   vz   dy 
                                         V x
                  v = nxu                   nx   ny   nz   dz 
                                                              
(dx,dy,dz)=(-eye·unor, -eye·vnor, -        0     0    0    1
eye·nnor)
   – To see what is stored in the modelview matrix
        • Define an array GLFloat mat[16]
        • Use glGetFloatv(GL_MODELVIEW_MATRIX,mat)

           mat:                       matT = V                     Modelview
                                                                   matrix will
                                                                   copy to mat[]
                                         Video Processing Lab                44
                                            臺灣師範大學數位媒體中心視訊處理研究室
Homework & next class
• Homework
  – A. Multi-points views, B. 3D projection
     • create one polyhedron such as cube or others
     • A. multi-points views and observe what happen
        – Perspective and Axonometric projections
     • B. 3D projection
        – Change x, y, z (axis) projection and observe what
          happen
• Next class will introduce how to construct
  3D object


                                 Video Processing Lab         45
                                    臺灣師範大學數位媒體中心視訊處理研究室
reference
• http://graphics.im.ntu.edu.tw/~robin
  /courses/
• http://www.cs.brown.edu/courses/cs
  123/lectures.shtml




                    Video Processing Lab   46
                       臺灣師範大學數位媒體中心視訊處理研究室

More Related Content

What's hot

Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
Mohd Arif
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
shivli0769
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
Yuffie Valen
 

What's hot (20)

Cyber security " الأمن السيبراني "
Cyber security " الأمن السيبراني  " Cyber security " الأمن السيبراني  "
Cyber security " الأمن السيبراني "
 
Parallel projection
Parallel projectionParallel projection
Parallel projection
 
Need for Web Engineering
Need for Web EngineeringNeed for Web Engineering
Need for Web Engineering
 
cyber security notes
cyber security notescyber security notes
cyber security notes
 
Curves and surfaces
Curves and surfacesCurves and surfaces
Curves and surfaces
 
3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals3D Graphics : Computer Graphics Fundamentals
3D Graphics : Computer Graphics Fundamentals
 
Two dimensional viewing
Two dimensional viewingTwo dimensional viewing
Two dimensional viewing
 
Firewall Design and Implementation
Firewall Design and ImplementationFirewall Design and Implementation
Firewall Design and Implementation
 
Data mining primitives
Data mining primitivesData mining primitives
Data mining primitives
 
Service level agreement in cloud computing an overview
Service level agreement in cloud computing  an overviewService level agreement in cloud computing  an overview
Service level agreement in cloud computing an overview
 
Introduction to the curves
Introduction to the curvesIntroduction to the curves
Introduction to the curves
 
Applications Of Computer Graphics
Applications Of Computer GraphicsApplications Of Computer Graphics
Applications Of Computer Graphics
 
Overview of computing paradigm
Overview of computing paradigmOverview of computing paradigm
Overview of computing paradigm
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
Client server s/w Engineering
Client server s/w EngineeringClient server s/w Engineering
Client server s/w Engineering
 
Distributed computing
Distributed computingDistributed computing
Distributed computing
 
Reverse engineering
Reverse  engineeringReverse  engineering
Reverse engineering
 
أساسيات أمن المعلومات
أساسيات أمن المعلوماتأساسيات أمن المعلومات
أساسيات أمن المعلومات
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
امن المعلومات الشخصية
امن المعلومات الشخصيةامن المعلومات الشخصية
امن المعلومات الشخصية
 

Viewers also liked (13)

3D transformation
3D transformation3D transformation
3D transformation
 
3 d viewing
3 d viewing3 d viewing
3 d viewing
 
CG OpenGL 3D object representations-course 8
CG OpenGL 3D object representations-course 8CG OpenGL 3D object representations-course 8
CG OpenGL 3D object representations-course 8
 
3 d
3 d3 d
3 d
 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
Object representations
Object representationsObject representations
Object representations
 
Computer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methodsComputer Graphics: Visible surface detection methods
Computer Graphics: Visible surface detection methods
 
Composite transformations
Composite transformationsComposite transformations
Composite transformations
 
transformation 3d
transformation 3dtransformation 3d
transformation 3d
 
3D transformation in computer graphics
3D transformation in computer graphics3D transformation in computer graphics
3D transformation in computer graphics
 
hidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithmhidden surface elimination using z buffer algorithm
hidden surface elimination using z buffer algorithm
 
Computer Animation PowerPoint
Computer Animation PowerPointComputer Animation PowerPoint
Computer Animation PowerPoint
 

Similar to CG OpenGL 3D viewing-course 7

The not so short
The not so shortThe not so short
The not so short
AXM
 
ANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentationANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentation
Anish Patel
 

Similar to CG OpenGL 3D viewing-course 7 (20)

CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6CG OpneGL 2D viewing & simple animation-course 6
CG OpneGL 2D viewing & simple animation-course 6
 
CG OpenGL polar curves & input display color-course 4
CG OpenGL polar curves & input display color-course 4CG OpenGL polar curves & input display color-course 4
CG OpenGL polar curves & input display color-course 4
 
CG OpenGL line & area-course 3
CG OpenGL line & area-course 3CG OpenGL line & area-course 3
CG OpenGL line & area-course 3
 
CG OpenGL vectors geometric & transformations-course 5
CG OpenGL vectors geometric & transformations-course 5CG OpenGL vectors geometric & transformations-course 5
CG OpenGL vectors geometric & transformations-course 5
 
Virtual Reality
Virtual RealityVirtual Reality
Virtual Reality
 
The not so short
The not so shortThe not so short
The not so short
 
CG simple openGL point & line-course 2
CG simple openGL point & line-course 2CG simple openGL point & line-course 2
CG simple openGL point & line-course 2
 
視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用視訊訊號處理與深度學習應用
視訊訊號處理與深度學習應用
 
NMSL_2017summer
NMSL_2017summerNMSL_2017summer
NMSL_2017summer
 
Presentación Tesis 08022016
Presentación Tesis 08022016Presentación Tesis 08022016
Presentación Tesis 08022016
 
Perception and Quality of Immersive Media
Perception and Quality of Immersive MediaPerception and Quality of Immersive Media
Perception and Quality of Immersive Media
 
Action Genome: Action As Composition of Spatio Temporal Scene Graphs
Action Genome: Action As Composition of Spatio Temporal Scene GraphsAction Genome: Action As Composition of Spatio Temporal Scene Graphs
Action Genome: Action As Composition of Spatio Temporal Scene Graphs
 
LLTECH LIGHT-CT SCANNER IMAGE ATLAS
LLTECH LIGHT-CT SCANNER IMAGE ATLASLLTECH LIGHT-CT SCANNER IMAGE ATLAS
LLTECH LIGHT-CT SCANNER IMAGE ATLAS
 
The not so short introduction to Kinect
The not so short introduction to KinectThe not so short introduction to Kinect
The not so short introduction to Kinect
 
Introduction talk to Computer Vision
Introduction talk to Computer Vision Introduction talk to Computer Vision
Introduction talk to Computer Vision
 
Action_recognition-topic.pptx
Action_recognition-topic.pptxAction_recognition-topic.pptx
Action_recognition-topic.pptx
 
ANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentationANISH_and_DR.DANIEL_augmented_reality_presentation
ANISH_and_DR.DANIEL_augmented_reality_presentation
 
Exemplar: Designing Sensor-based interactions by demonstration... (a CHI2007 ...
Exemplar: Designing Sensor-based interactions by demonstration... (a CHI2007 ...Exemplar: Designing Sensor-based interactions by demonstration... (a CHI2007 ...
Exemplar: Designing Sensor-based interactions by demonstration... (a CHI2007 ...
 
FASSOLD Deep learning for semantic analysis and annotation of conventional an...
FASSOLD Deep learning for semantic analysis and annotation of conventional an...FASSOLD Deep learning for semantic analysis and annotation of conventional an...
FASSOLD Deep learning for semantic analysis and annotation of conventional an...
 
Computer vision
Computer visionComputer vision
Computer vision
 

More from fungfung Chen

More from fungfung Chen (20)

Tech biz patent
Tech biz patent Tech biz patent
Tech biz patent
 
Smart TV content converged service & social media
Smart TV content converged service & social mediaSmart TV content converged service & social media
Smart TV content converged service & social media
 
Tips for fulfilling patent application
Tips for fulfilling patent applicationTips for fulfilling patent application
Tips for fulfilling patent application
 
Defending your Rights
Defending your RightsDefending your Rights
Defending your Rights
 
Polishing search skills
Polishing search skillsPolishing search skills
Polishing search skills
 
Inquiry Based Approach - Patent Search
Inquiry Based Approach - Patent SearchInquiry Based Approach - Patent Search
Inquiry Based Approach - Patent Search
 
Overseas protection & patent search
Overseas protection & patent searchOverseas protection & patent search
Overseas protection & patent search
 
Patentability classification search
Patentability classification searchPatentability classification search
Patentability classification search
 
Novelty to Nonobviousness
Novelty to NonobviousnessNovelty to Nonobviousness
Novelty to Nonobviousness
 
Patentability requirement on novelty
Patentability requirement on noveltyPatentability requirement on novelty
Patentability requirement on novelty
 
2012 Smart TV - Evolution & Approaches
2012 Smart TV - Evolution & Approaches2012 Smart TV - Evolution & Approaches
2012 Smart TV - Evolution & Approaches
 
Patentability Requirements
Patentability RequirementsPatentability Requirements
Patentability Requirements
 
Working model to patentability
Working model to patentabilityWorking model to patentability
Working model to patentability
 
Evaluate your invention
Evaluate your inventionEvaluate your invention
Evaluate your invention
 
how to invention & practice it
how to invention & practice ithow to invention & practice it
how to invention & practice it
 
Digital converge - DTV service design
Digital converge - DTV service designDigital converge - DTV service design
Digital converge - DTV service design
 
Hybrid digital broadcasting methods
Hybrid digital broadcasting methodsHybrid digital broadcasting methods
Hybrid digital broadcasting methods
 
Summary the challenges of Social TV
Summary the challenges of  Social TVSummary the challenges of  Social TV
Summary the challenges of Social TV
 
CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10CG OpenGL Shadows + Light + Texture -course 10
CG OpenGL Shadows + Light + Texture -course 10
 
CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9CG OpenGL surface detection+illumination+rendering models-course 9
CG OpenGL surface detection+illumination+rendering models-course 9
 

Recently uploaded

How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
mark11275
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
amitlee9823
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
nirzagarg
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
TusharBahuguna2
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
instagramfab782445
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
nirzagarg
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
wpkuukw
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
kumaririma588
 

Recently uploaded (20)

How to Build a Simple Shopify Website
How to Build a Simple Shopify WebsiteHow to Build a Simple Shopify Website
How to Build a Simple Shopify Website
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
8377087607, Door Step Call Girls In Kalkaji (Locanto) 24/7 Available
 
Sweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptxSweety Planet Packaging Design Process Book.pptx
Sweety Planet Packaging Design Process Book.pptx
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Escorts Service Nagavara ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard  ...
Anamika Escorts Service Darbhanga ❣️ 7014168258 ❣️ High Cost Unlimited Hard ...
 
Design Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptxDesign Inspiration for College by Slidesgo.pptx
Design Inspiration for College by Slidesgo.pptx
 
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
Abortion pill for sale in Muscat (+918761049707)) Get Cytotec Cash on deliver...
 
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls AgencyHire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
Hire 💕 8617697112 Meerut Call Girls Service Call Girls Agency
 
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
Nisha Yadav Escorts Service Ernakulam ❣️ 7014168258 ❣️ High Cost Unlimited Ha...
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
 
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experiencedWhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
WhatsApp Chat: 📞 8617697112 Call Girl Baran is experienced
 
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...Top Rated  Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
Top Rated Pune Call Girls Koregaon Park ⟟ 6297143586 ⟟ Call Me For Genuine S...
 
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
一比一定(购)卡尔顿大学毕业证(CU毕业证)成绩单学位证
 
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...Booking open Available Pune Call Girls Kirkatwadi  6297143586 Call Hot Indian...
Booking open Available Pune Call Girls Kirkatwadi 6297143586 Call Hot Indian...
 
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...AMBER GRAIN EMBROIDERY | Growing folklore elements |  Root-based materials, w...
AMBER GRAIN EMBROIDERY | Growing folklore elements | Root-based materials, w...
 
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Vasundhra (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...Verified Trusted Call Girls Adugodi💘 9352852248  Good Looking standard Profil...
Verified Trusted Call Girls Adugodi💘 9352852248 Good Looking standard Profil...
 

CG OpenGL 3D viewing-course 7

  • 1. 3D Viewing Chen Jing-Fung (2006/12/1) Assistant Research Fellow, Digital Media Center, National Taiwan Normal University Video Processing Lab 臺灣師範大學數位媒體中心視訊處理研究室 Ch7: Computer Graphics with OpenGL 3th, Hearn Baker Ch5: Interactive Computer Graphics 3th, Addison Wesley
  • 2. 3D viewing framework • How to view 3D • Some kind types of 3D projections • How to do 3D views Video Processing Lab 2 臺灣師範大學數位媒體中心視訊處理研究室
  • 3. 3D viewing device • Virtual-Reality System-Amsterdam R.G. Belleman, PhD, (application at the company of Sara) 3 Video Processing Lab http://www.science.uva.nl/research/scs/projects/visualisation/index.php?page=hardware 臺灣師範大學數位媒體中心視訊處理研究室
  • 4. How to make it ? Video Processing Lab 4 臺灣師範大學數位媒體中心視訊處理研究室
  • 5. 2D -> 3D • 2D graphics application and viewing 2D view operations transfer positions no parallax – The world-coordinate plane -> pixel positions output plane – Rectangular boundaries for clipping window • Clip a scene and maps it to device coordinate monitor • 3D viewing (more choices than 2D) – How to construct a scene – How to generate views it on output device Video Processing Lab 5 臺灣師範大學數位媒體中心視訊處理研究室
  • 6. Two eyes game • Two eyes = two separate vision angle – Close one eye – Put your free finger to aim “bowling” – Switch to close another eye Two eyes vision angle is same? Video Processing Lab 6 http://www.vision3d.com/stereo.html 臺灣師範大學數位媒體中心視訊處理研究室
  • 7. How to see 3D? • Two eyes can see 3D – Two images be captured by two eyes – Images arrive simultaneously in the back of the brain – They are united into one picture brain A key point of 3D view is depth !! an object’s solid in three spatial dimensions: width, height and depth -- x, y and z. Video Processing Lab 7 http://www.vision3d.com/stereo.html 臺灣師範大學數位媒體中心視訊處理研究室
  • 8. Overview 3D viewing concepts • Object in 3D scene – A set of surfaces (object descriptions) • Generate views of an object’s surface features – Closed boundary around the object • Provide routines – displaying internal components – Cross-sectional views of a solid object Video Processing Lab 8 臺灣師範大學數位媒體中心視訊處理研究室
  • 9. Viewing 3D scene • Set up a coordinate reference for the viewing - “camera” parameters – The coordinate reference defines • Position and orientation for a view plane or projection plane – Object descriptions • Transferred to viewing coordinates • Projected onto the view plane Video Processing Lab 9 臺灣師範大學數位媒體中心視訊處理研究室
  • 10. 3D viewing process Clipping Project to Viewport process projection plane transformation Object Output Clipping (scene) - device - (Camera) - coordinate coordinate coordinate Video Processing Lab 10 臺灣師範大學數位媒體中心視訊處理研究室
  • 11. Classical views Front elevation Elevation oblique Plan oblique One-point perspective Three-point perspective isometric Video Processing Lab 11 臺灣師範大學數位媒體中心視訊處理研究室
  • 12. Three projections • Introduction projection & views • Axonometric projections • Oblique projections • Perspective projections Video Processing Lab 12 臺灣師範大學數位媒體中心視訊處理研究室
  • 13. Parallel-projection views • Orthographic projection: show accurate dimensions – Used in engineering and architectural side front top Video Processing Lab 13 臺灣師範大學數位媒體中心視訊處理研究室
  • 14. multi-view orthographic Plan view • projection plane is (top view) parallel to one of the object’s principal faces. • display at least three views- such as the front, top and right side view front view (right view) Video Processing Lab 14 臺灣師範大學數位媒體中心視訊處理研究室
  • 15. Axonometric projections • Preserve how many views direct by original object **projected lines is parallel but angles are not • Foreshortening: an object appears compressed plane (projected) which extracted by a particular viewpoint • Dimetric view • Two different foreshortening ratios • Trimetric view (general case) • Three different foreshortening ratios • Isometric view • Symmetrical projection of three principal directions Q: Symmetrical two principal faces? Video Processing Lab 15 臺灣師範大學數位媒體中心視訊處理研究室
  • 16. Projected vs. original • Lines are scaled and can find scale ratios • Angles are not related projected • • View box-like object on projection plane • Not look real: – No matter how objectproj is near or far, it has the same projection axonometric views are used extensively in architectural and mechanical design Video Processing Lab 16 臺灣師範大學數位媒體中心視訊處理研究室
  • 17. Clipping window projection • Orthogonal-projection view volume (view plane) Clipping window – 2D rectangular clipping Far plane window -> 3D near-far Near plane clipping planes (box-like) Normalized view volume Orthogonal-projection yview (xwmax,ywmax,zfar) ynorm znorm view volume (1,1,1) zview xview Project xnorm (xwmin,ywmin,znear) (-1,-1,-1) glMatrixMode (GL_PROJECTION) glLoadIdentity() glOrtho(xwmin,xwmax,ywmin,ywmax,znear,zfar) Video Processing Lab 17 臺灣師範大學數位媒體中心視訊處理研究室
  • 18. Real case about Axonometric projections • Technically some games (strategy or simulation) use this projection to show object’s distance whether near or far Video Processing Lab 18 臺灣師範大學數位媒體中心視訊處理研究室
  • 19. Oblique projections • Oblique views are the most general views – Can make an arbitrary angle with projection plane • Angles can be preserved – projected • The most difficult to construct by hand • Bellows camera is flexible to produce approximations to parallel oblique views **Oblique view are somewhat unnatural. Video Processing Lab 19 臺灣師範大學數位媒體中心視訊處理研究室
  • 20. Clipping – Oblique projections • CG-Oblique projections – Objectworld -> objectrotate -> objectproj Clipping window Clipping window View plane Near plane Transformed Oblique view volume Shear View volume Vp transformation Far plane Oblique-projection view volume Moblique,norm=Mortho,norm * Moblique Video Processing Lab 20 臺灣師範大學數位媒體中心視訊處理研究室
  • 21. Orthogonal projection vectors • DOP = -VPN VUP: view-up vector to this plane View plane DOP: projection’s direction VPN: view-plane normal VPN: view-plane normal • Vector u & v in plane A v Plane A – viewPN=uxv/det|uv| u Video Processing Lab 21 http://www.cmlab.csie.ntu.edu.tw/~robin/courses/ 臺灣師範大學數位媒體中心視訊處理研究室
  • 22. Projection tunnel Clipping window projection plane view plane Any point DOP VRP CW ∞ PRP VPN (umin,vmin) (umav,vmax) Video Processing Lab 22 臺灣師範大學數位媒體中心視訊處理研究室
  • 23. Orthogonal projection - Oblique Clipping window View Near plane Transformed Oblique- Oblique view projection view Shear volume Vp volume Far • Translate the VRPclip to the origin • Rotate VRC to projected plane (PRP) • Shear that let the DOP become parallel to the projected plane (PRPshear) • Translate and scale into the parallel-projection normal view volume No =Sp_prp Tp_prp SHprp Rvrc T(VRP) Video Processing Lab 23 http://www.cmlab.csie.ntu.edu.tw/~robin/courses/ 臺灣師範大學數位媒體中心視訊處理研究室
  • 24. Perspective projections monitor Video Processing Lab 24 http://groups.csail.mit.edu/graphics/classes/6.837/F04/calendar.html 臺灣師範大學數位媒體中心視訊處理研究室
  • 25. Projection tunnel view plane projection plane VRP Clipping window PRP VPN COP COP Video Processing Lab 25 臺灣師範大學數位媒體中心視訊處理研究室
  • 26. Depth cueing • Depth information is important in 3D scene – Easy identify the particular viewing direction • The front and back of each displayed object No depth information Downward from above Upward from below base vertex Video Processing Lab 26 臺灣師範大學數位媒體中心視訊處理研究室
  • 27. Perspective-projection view volume Rectangular view Frustum window view volume Projection reference point θ (xprp,yprp,zvp) (xprp,yprp,zprp) Near clipping Far clipping plane plane Video Processing Lab 27 臺灣師範大學數位媒體中心視訊處理研究室
  • 28. OpenGL Perspective- Projection (p.p) Function θ/2 • Symmetric p.p function View plane gluPerspective(theta, aspect, dnear, dfar) zprp-zvp • Four parameters: double or float point • Theta (field-of-view angle): angle between top and bottom • Aspect ratio: (width/height) • dnear & dfar: negative, because clipping plane must always be somehow along the –zview axis (behind the view position) Video Processing Lab 28 臺灣師範大學數位媒體中心視訊處理研究室
  • 29. Aspect ratio (width)x (height) Sony PSP 4.3” ST-International 19” Panasonic 42 ” 80mmx15mm 500mmx485mm ~1:1 16:9 Video Processing Lab 29 臺灣師範大學數位媒體中心視訊處理研究室
  • 30. OpenGL p.p function (2) Frustum view volume • General p.p function gluFrustum(xwmin, xwmax, ywmin, ywmax, zwnear, zwfar) Near plane Far plane • All parameters: double or float point numbers • zwnear & zwfar : negative (behind the view position) as tha same as dnear & dfar • Clipping window can be specified anywhere on the near plane. – Xwmin = -xwmax & ywmin = -ywmax Video Processing Lab 30 臺灣師範大學數位媒體中心視訊處理研究室
  • 31. 3D viewing process Clipping Project to Viewport process projection plane transformation Object Output Clipping (scene) - device - (Camera) - coordinate coordinate coordinate Video Processing Lab 31 臺灣師範大學數位媒體中心視訊處理研究室
  • 32. 3D scene process by CG • Choose a viewing position (camera) – Point to where camera (camera position) • Choose a viewing position (object) – Display a front, back, side, top, or bottom view Video Processing Lab 32 臺灣師範大學數位媒體中心視訊處理研究室
  • 33. Synthetic camera • First, pick a position (object fixed) COP – Middle of a group of objects – Inside a single object • Camera located in COP – Focus on camera’s motion – Rotate it – Choose a parallel or perspective projection • Eliminate parts of a scene along the line of sight Video Processing Lab 33 臺灣師範大學數位媒體中心視訊處理研究室
  • 34. Projections (views) Perspective projection (views): •center of projection (COP) Parallel projection (views): •More realistic like •Direction of projection (DOP) our eyes and camera lens •View space: near & far object projector object projector Projection plane finite COP infinite COP Projection plane **depth!! Video Processing Lab 34 臺灣師範大學數位媒體中心視訊處理研究室
  • 35. One-point perspective view Video Processing Lab 35 http://www.richardmurphyarchitects.com/projects/images 臺灣師範大學數位媒體中心視訊處理研究室
  • 36. Two-point perspective views Video Processing Lab 36 http://www.cityofmoorhead.com/whats_new/downtown/Perspective.jpg 臺灣師範大學數位媒體中心視訊處理研究室
  • 37. Three-points views 37 The Music Lesson, c.1662-1665 Video Processing Lab 臺灣師範大學數位媒體中心視訊處理研究室
  • 38. Multi-perspective views • Advantage – Objects can display multi-view and show the relation about near and far • Look realistic • Disadvantage – Object has not parallel lines – Difficult by hand ( easy by computer design) Video Processing Lab 38 臺灣師範大學數位媒體中心視訊處理研究室
  • 39. Positioning of the camera frame • Camera can be move by designer – Follow the rotation steps COP • glMatrixMode(GL_MODELVIEW) • glLoadIdentity() • glTranslatef() • glRotatef() • …. Video Processing Lab 39 臺灣師範大學數位媒體中心視訊處理研究室
  • 40. VPN VUP VRP v Two viewing APIs u Camera frame • Only one view direction is a little unsatisfying – Starting points in the world frame • Describe the camera’s position and orientation in this • glLoadIdentity() -> set_view_reference_point(x,y,z) • The orientation of the camera divide two parts – VPN: set_view_plane_normal (xn, yn, zn) – VUP: set_view_up(xvup, yvup,zvup) • Do transformation operators Video Processing Lab 40 臺灣師範大學數位媒體中心視訊處理研究室
  • 41. Look-at function • A more direct method is appropriate the camera (xref, yref, zref) gluLookAt(xeye, yeye, zeye, xref, yref, zref, xup, yup, zup) (xup, yup, zup) • (xeye, yeye, zeye) = world- coordinate position P0 Ex: (0,0,0) camera (xeye, yeye, zeye) • VUP= (xup, yup, zup) Ex: y-axis (0,1,0) monitor • VRP=(xref, yref, zref) = projection position Pref Ex: (0,0,-1) • VPN=P0-Pref **viewing direction is along to any axis (maybe z-axis or –z-axis) Video Processing Lab 41 臺灣師範大學數位媒體中心視訊處理研究室
  • 42. Set up a typical camera • Cameras are often set to “look down” on a scene from some nearby position • Ex: eye=(4,4,4), look=(0,1,0), upward up=(0,1,0), view volume width=6.4 & height=4.8 (aspect ratio = 640/480), near =1 & far =50 glMatixMode(GL_PROJECTION);//set the view volume y glLoadIdentity(); look at glOrtho(-3.2,3.2,-2.4,2.4, 1,50);//or use Frustumview volume z glMatrixMode(GL_MODELVIEW);//place and aim the camera glLoadIdentity(); gluLookAt(4,4,4,0,1,0,0,1,0); x Video Processing Lab 42 臺灣師範大學數位媒體中心視訊處理研究室
  • 43. What does gluLookAt() do? • gluLookAt() builds a matrix (V) that converts world coordinates into eye coordinates (eyeu,v,n). n = eye-look up u = upxn v v = nxu n u gluLookAt()  ux uy uz dx  eye matrix   V vx vy vz dy   nx ny nz dz    0 0 0 1 look (dx,dy,dz)=(-eye·unor, -eye·vnor, -eye·nnor) Video Processing Lab 43 臺灣師範大學數位媒體中心視訊處理研究室
  • 44. Inquiring about values in a matrix in OpenGL • gluLookAt(4,4,4,0,1,0,0,1,0); – Eye: (4,4,4), look: (0,1,0), up: (0,1,0) n = eye-look  ux uy uz dx  u = upxn   v vy vz dy  V x v = nxu  nx ny nz dz    (dx,dy,dz)=(-eye·unor, -eye·vnor, - 0 0 0 1 eye·nnor) – To see what is stored in the modelview matrix • Define an array GLFloat mat[16] • Use glGetFloatv(GL_MODELVIEW_MATRIX,mat) mat: matT = V Modelview matrix will copy to mat[] Video Processing Lab 44 臺灣師範大學數位媒體中心視訊處理研究室
  • 45. Homework & next class • Homework – A. Multi-points views, B. 3D projection • create one polyhedron such as cube or others • A. multi-points views and observe what happen – Perspective and Axonometric projections • B. 3D projection – Change x, y, z (axis) projection and observe what happen • Next class will introduce how to construct 3D object Video Processing Lab 45 臺灣師範大學數位媒體中心視訊處理研究室
  • 46. reference • http://graphics.im.ntu.edu.tw/~robin /courses/ • http://www.cs.brown.edu/courses/cs 123/lectures.shtml Video Processing Lab 46 臺灣師範大學數位媒體中心視訊處理研究室