SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
Simple OpenGL
Program (point & line)
       Chen Jing-Fung (2006/11/13)
        Assistant Research Fellow,
           Digital Media Center,
     National Taiwan Normal University




                           National Taiwan Normal University
Displayers
• CRT & Flat-panel Display




           http://www.plasmadepot.com/plasmatv/plasmatv101.html
                                                        2
CRT
            (Cathode ray tube)
      • Cutaway rendering of a color CRT

                                                  Display Mask
                                  Anode connection             Phospfor layer
                            Deflection coils
                         Focusing coils
                  Electron beams
                  Electron guns
                                                                  Close-up of the
                                                                  Phospfor layer




                                                                            3
http://en.wikipedia.org/wiki/Cathode_ray_tube
TFT LCD (Thin Film Transistor
    Liquid Crystal Display)
     • TFT LCD has a sandwich-like structure
       with liquid crystal filled between two glass
       plates.




                                                      4
http://www.plasma.com/classroom/what_is_tft_lcd.htm
PDP
      (Plasma Display Panel)
     • A plasma TV is sometimes called an "emissive"
       display — the panel is actually self-lighting.

     • The display consists of two transparent glass
       panels with a thin layer of pixels sandwiched in
       between.




                                                          5
http://www.plasmadepot.com/plasmatv/howplasmaworks.html
What is different?
• CRT
  – Electrostatic deflection of the electron
    beam
• LCD
  – Back light module
• PDP
  – Tiny colored fluorescent lights




                                               6
DIY your projector

                                                           USD$200




       Cutaway rendering of the projector              Fresnel Lens



                                                                       Conventional
                                                                       Lens



               5.5’’ LCD + VCD
               player = $169 USD                      http://en.wikipedia.org   7
http://www.audiovisualizers.com/madlab/lcd_proj.htm
Basic video-controller
 refresh operations
                                  Horizontal and Vertical
    Raster-Scan Generator         Deflection Voltage




    x Register   y Register



      Memory Address             Pixel Register   Intensity




                  Frame Buffer

                                                              8
Frame Buffer
• Cartesian reference frame with
  origin at the lower-left corner of a
  video monitor

                     y




                                x


                                         9
Coordinate
                    representations
                           Viewing & Projection
                               Coordinates

                                  1       1
    Modeling                                   1    Video Monitor
(local or master)
   Coordinates
                                                      Plotter
                      World           Normalized
                    (Cartesian)       Coordinates
                    Coordinates
                                                    Other Output

                                                       Device
                                                     Coordinates
                                                                    10
• Coordinates:
  – Modeling (m), World (w), Viewing (v),
    Projection (p), Normalized (n), Device (d)

    • (xmc, ymc, zmc) -> (xwc, ywc, zwc) -> (xvc, yvc, zvc)
      -> (xpc, ypc, zpc) -> (xnc, ync, znc) -> (xdc, ydc)




                                                              11
Graphs system
 • User program, Graphics system, I/O
   devices

          Function calls              Output

  User                     Graphics
                                               I/O devices
program                     system
              Data                    Input




                                                       12
Application Programming
Interface (API) Functions

• Divide API functions into seven
  groups:
  –   Primitive functions
  –   Attribute functions
  –   Transformation functions
  –   Viewing functions
  –   Input functions
  –   Control functions

                                    13
Primitive & Attribute

• Primitive functions - graphics output
  primitives
  – Character strings & geometric entities
     • Points, lines, areas and shapes (2D, 3D)
• Attribute functions - Properties of the
  output primitives
  – Describe how a particular primitive is to be
    displayed
     • Color specifications, line styles, text styles and area-
       filling patterns …

                                                              14
Viewing
• Select a view of the scene -> type of
  projection -> location on monitor
• Other routines:
  – Managing the scene display area
    • Specifying its position, size and structure
    • Identified visible objects and applied
      lighting conditions (3D)




                                                    15
Software standards - GL
 • Graphics Library (GL)
   a widely used package in the graphics community
    – Goal: fast, real-time rendering and package was being
      extended to other hardware systems.
    – International Standard Organization (ISO)
       • Graphical kernel system (GKS) 1984
           – 2D & 3D
       • Programmer’s Hierarchical Interactive Graphics Standard
         (PHICS)
           – Increase: object modeling, color specification, surface
             rendering…
           – PHICS+ (3D)




                                                                       16
Software standards -
      OpenGL

• OpenGL : a hardware-independent
  version of GL in the early 1990s.
• The graphics package is maintained
  and updated by OpenGL Architecture
  Review Board.
• Language binding
  – C and C++


                                   17
Other Graphics Packages
• Graphics libraries
  –   Java 2D (Java applets)
  –   Java 3D
  –   Mathematica
  –   Matlab
  –   Maple…




                               18
Introduction to OpenGL
• Overview OpenGL based on VC++
  – http://dev.yesky.com/424/2080424.shtml
• Basic OpenGL Syntax
  – Function names in OpenGL basic Library
     • Ex: glBegin, glClear, glCopyPixels…
  – Arguments in Function (interval: _ )
     • Ex: GL_2D, GL_RGB, GL_POLYGON…
  – Specific data types
     • Ex: GLbyte, GLshort, Glint…




                                             19
OpenGL –
    Related Libraries
• GL: basic core library (prefix: gl)
• OpenGL Utility (GLU): (prefix: glu)
  – Setting up viewing and projection matrices
  – describing complex objects with line and
    polygon
  – Displaying quadrics and B-splines
  – Processing the surface-rendering operations
  – Other complex tasks



                                                  20
OpenGL-
      Display window
• OpenGL Extension:
  – X Window System (GLX) - Prefix: plX
  – Apple GL (AGL) - Prefix: agl
  – Microsoft Windows system (WGL) -
    Prefix: wgl
  – IBM OS/2 (Presentation Manager to
    OpenGL: PGL) - Prefix: pgl



                                          21
OpenGL Utility Toolkit
      (GLUT)
– Provide a library of functions for
  interacting with any screen-windowing
  system.
  • Prefix: glut
  • Contain: describing and rendering quadric
    curves and surfaces
  • Download: (glut-3.7.6-bin.zip ~117 KB)
    http://www.xmission.com/~nate/glut.html



                                                22
How to Use GLUT?

• Put 3 files from ``glut-3.7.6-bin.zip’’
  in your project directory.
  – README-win32.txt
     • glut32.dll to %WinDir%System
     • glut32.lib to $(MSDevDir)....VC98lib
     • glut.h to $(MSDevDir)....VC98includeGL




                                                23
Setup for a OpenGL
        Program 1/5
• Microsoft Visual C++ 6.0
  – Step 1: create a Win32 Console Application project




                                                   24
Setup for a OpenGL
     Program 2/5
– Step 2:Press Alt-F7 project -> settings...->Link
– Step 3:add opengl32.lib glu32.lib glut32.lib
  into Object/library modules




                                                 25
Setup for a OpenGL
        Program 3/5
• Microsoft Visual C++ .Net
  – Step 1:create Win32 console project




                                          26
Setup for a OpenGL
    Program 4/5
– Step 2: select ―empty project‖




                                   27
Setup for a OpenGL
    Program 5/5
– Step 3:select project->property…->linker ->
  input
– Step 4: add opengl32.lib glu32.lib glut32.lib




                                                  28
Header Files             2/1

• Include the header file the OpenGL
  core library
  – #include <windows.h>
    • With Microsoft Windows
  – #include <GL/gl.h>
    • Basic core library
  – #include <GL/glu.h>
    • Object-oriented toolkit & 3D application




                                                 29
Header Files                   2/2

• Use GLUT to handle the window-managing
  operations.
  – #include <GL/glut.h>
     • gl.h, glu.h (redundant and could affect program
       portability)
• Need to include c++ code
  – #include <stdio.h> #include <stdlib.h> #include
    <math.h>…
• ISO/ANSI standard for c++
  – Include: cstdio, cstdlib and cmath


                                                         30
Display-Window
   Management Using GLUT
                           2/1
• Initialization function
   – glutInit(&argc, argv);
• Create display window (DW) and caption
   – glutCreateWindow(―An Example OpenGL Program‖);
• Assign our picture to DW – Ex: describing a line
  segment
   – glutDisplayFunc(lineSegment);
• But DW is not yet. More GLUT function -> complete
  the window-processing operations
   – glutMainLoop( ); <- the last line (check all input devices –
     mouse or keyboard)


                                                                31
Display-Window
   Management Using GLUT
                         2/2
• Top-left corner of the video display (50,100)
   – glutInitWindowPosition(50, 100);
• Display window of OpenGL: width=400 pixels and
  height= 300pixels
   – glutInitWindowSize(400, 300);           100
                                        50



                     Display window
                                                         300
                                                   400

   • A single refresh buffer & RGB mode
       – glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB)

                                                           32
A complete OpenGL
       Program 2/1
• Set background color: white
  – glClearColor(1.0, 1.0, 1.0, 0.0); <- alpha value is
    as a ``blending’’ parameter.
• Get the assigned window color displayed
  – glClear(GL_COLOR_BUFFER_BIT);
• Set object color
  – glColor3f(1.0, 0.0, 0.0);




                                                          33
A complete OpenGL
     Program 2/2
• OpenGL processes our picture (2D line)
  through the full 3D viewing operations –
  “project’’
  – glMatrixMode(GL_PROJECTION);
• Map rectangle
  – glOrtho2D(0.0, 200.0, 0.0, 150.0);
• Cartesian endpoint coordinate
  – glBegin(GL_LINES);
        glVertex2i(180, 15);
        glVertex2i(10, 145);
    glEnd();


                                             34
35
Display function

   User define




                   36
Point Specification
• OpenGL functions
  – glVertex*();<-The coordinate values
         – EX:   glBegin (GL_POINTS);
                      glVertex2iv (p1); //i: integer   y
                      glVertex2iv (p2);
                      glVertex2iv (p3);
                 glEnd ();
                                                                p2
• C++ class or structure                                   p1        p3
  – Ex: Class wcPt2D {
        Public:                    wcPt2D pointPos;                       x
                  GLfloat x, y;    pointPos.x = 120.75;
         };                        pointPos.y = 45.30;
                                   glBegin (GL_POINTS);
                                           glVertex2f (pointPos.x,
                                        pointPos.y);
                                        glEnd ();
                                                                     37
OpenGL Line functions
        glBegin (*);
             glVertex2iv (p1);
             glVertex2iv (p2);
             glVertex2iv (p3);
             glVertex2iv (p4);
             glVertex2iv (p5);
        glEnd ();
          p3                          p3                   p3

                   p1            p5         p1     p5               p1



 p2                p4            p2        p4      p2               p4
Primitive line generated     polyline generated   Closed polyline generated
 with GL_LINES               with GL_LINE_STRIP   with GL_LINE_LOOP


                                                                     38
Line-drawing algorithms
                    2/1
• A straight-line segment in a scene is
  defined by the coordinate positions for
  the endpoints of the segment.

• Line is compose of the nearest pixel
  positions along the line path between the
  two endpoints.

• Ex: point
  (10.48, 20.51)->(10,21)

                                              39
Line-drawing algorithms
                    2/2
• The Cartesian slope-intercept
  equation for a straight line
  – y=m*x+b Dy           Dx

  – slope m=(yend-y0)/(xend-x0)        yend

                                        y0
  – Intercept b=y0-m*x0
• Digital differential analyzer               x0          xend

     Dx = 1, yk+1 = yk + m Dy

     Dy = 1, xk+1 = xk + 1/m Dx
    • Steps?                    yend

    ?? Dx = -1 ? or Dy = -1 ?     yk
                                                           40
                                       xk          xend
How to a parameter
   drawing line?




          National Taiwan Normal University
Bresenham’s line algorithm
                        3/1
• Bresenham’s line is an accurate and
  efficient raster line-generating algorithm
• Use only incremental integer calculations.
• Determine at next sample point whether
  to plot.
  – The negative-slope line:
    if start point (50, 50), next point?
     • (51, 50) or (51, 49)




                                               42
Analysis Bresenham’s line
            algorithm
• The scan-conversion process:
  – Set the positive slope < 1.0 and start point (x0, y0)
  – Let the kth step in this process, therefore, the
    displayed pixel (xk, yk)
     • Next pixel (xk+1, yk) or (xk+1, yk+1)
  – The sampling position xk+1, depend on (dlow- dup)
     • The label vertical pixel separations from dlow and dup
     • Pk=Dx(dlow-dup) is the same as the sign of (dlow- dup)
         – If yk ~ line, (dlow< dup), then pk< 0
         – Next pk+1 ?                             yk+1   m
         – First parameter p0 ?                     yk
                                                                 1-m


                                                              xk+1
                                                                     43
Bresenham’s line algorithm
                        3/3(m<1.0)
• Step 1: Input left endpoint (x0, y0)
• Step 2: Set the color for frame-buffer position (x0, y0)
• Step 3: Calculate Dx, Dy, 2Dy and 2Dy-2Dx
   – If yk+1>yk, p0=2Dy-Dx, else yk+1<yk, p0=2Dy+Dx   yk+3          y = mx + b
• Step 4: The decision parameter pk+1                 yk+2
   – If pk<0 & next point is (xk+1, yk)               yk+1           y
       • pk+1= pk+2Dy                                  yk
   – Else next point is (xk+1, yk+1)                           xk xk+1 xk+2 xk+3
       • pk+1= pk+2Dy-2Dx
• Step 5: return step 4 Dx-1 times
                                            yk+1       m
                                             yk
                                                                1-m


                                                             xk+1          44
Bresenham’s line example
 • Start point: (20, 10)
 • End point: (30, 18)




                           45
Homework
• HW 1: Draw line from (30, 150) to
  (200, 10)
  – Hint : line-drawing algorithm
  – If you use one decision parameter to do,
    you will get the reward.
• HW 2: Plot the regular polygon (3, 4,
  5, cycle)


                                           46
Two important points of
      Homework
• Explain (30%)



• Program (70%)




                          47
References
• .Net Education website:
  – http://yes.nctu.edu.tw/DotNet/index.ht
    m
• Mathworld
  – http://mathworld.wolfram.com/




                                         48

Weitere ähnliche Inhalte

Was ist angesagt?

SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondMark Kilgard
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportJungsoo Nam
 
StateScriptingInUncharted2
StateScriptingInUncharted2StateScriptingInUncharted2
StateScriptingInUncharted2gcarlton
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGLJungsoo Nam
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingMark Kilgard
 

Was ist angesagt? (8)

SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and BeyondSIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
SIGGRAPH Asia 2012 Exhibitor Talk: OpenGL 4.3 and Beyond
 
Implement Checkpointing for Android (ELCE2012)
Implement Checkpointing for Android (ELCE2012)Implement Checkpointing for Android (ELCE2012)
Implement Checkpointing for Android (ELCE2012)
 
Implement Checkpointing for Android
Implement Checkpointing for AndroidImplement Checkpointing for Android
Implement Checkpointing for Android
 
Android OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final ReportAndroid OpenGL ES Game ImageGrabber Final Report
Android OpenGL ES Game ImageGrabber Final Report
 
StateScriptingInUncharted2
StateScriptingInUncharted2StateScriptingInUncharted2
StateScriptingInUncharted2
 
13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL13th kandroid OpenGL and EGL
13th kandroid OpenGL and EGL
 
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path RenderingSIGGRAPH Asia 2012: GPU-accelerated Path Rendering
SIGGRAPH Asia 2012: GPU-accelerated Path Rendering
 
Hardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for AndroidHardware Accelerated 2D Rendering for Android
Hardware Accelerated 2D Rendering for Android
 

Andere mochten auch

Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Saikrishna Tanguturu
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithmsMohammad Sadiq
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTvineet raj
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSRAJEEV KUMAR SINGH
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmMahesh Kodituwakku
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.Mohd Arif
 
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 10fungfung Chen
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraguest1f4fb3
 
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)Display types (LED, LCD, Plasma, Plotter, Virtual Reality)
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)Ravi Yasas
 
Computer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmComputer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmRAJEEV KUMAR SINGH
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c versionMarwa Al-Rikaby
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainAmit Kumar
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics PracticalNeha Sharma
 
Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithmUmesh Gupta
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingVimal Dewangan
 

Andere mochten auch (17)

Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
Computer Graphics - Bresenham's line drawing algorithm & Mid Point Circle alg...
 
Lines and curves algorithms
Lines and curves algorithmsLines and curves algorithms
Lines and curves algorithms
 
COMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORTCOMPUTER GRAPHICS PROJECT REPORT
COMPUTER GRAPHICS PROJECT REPORT
 
OpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELSOpenGL Projects on SIMULATION OF WATER RIPPELS
OpenGL Projects on SIMULATION OF WATER RIPPELS
 
Bresenham Line Drawing Algorithm
Bresenham Line Drawing AlgorithmBresenham Line Drawing Algorithm
Bresenham Line Drawing Algorithm
 
Line drawing algo.
Line drawing algo.Line drawing algo.
Line drawing algo.
 
Computer graphics
Computer graphics   Computer graphics
Computer graphics
 
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
 
KRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitraKRUSKAL'S algorithm from chaitra
KRUSKAL'S algorithm from chaitra
 
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)Display types (LED, LCD, Plasma, Plotter, Virtual Reality)
Display types (LED, LCD, Plasma, Plotter, Virtual Reality)
 
Computer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithmComputer graphics mini project on bellman-ford algorithm
Computer graphics mini project on bellman-ford algorithm
 
Bresenham circle
Bresenham circleBresenham circle
Bresenham circle
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 
Computer Graphics Project- The Running Train
Computer Graphics Project- The Running TrainComputer Graphics Project- The Running Train
Computer Graphics Project- The Running Train
 
Computer Graphics Practical
Computer Graphics PracticalComputer Graphics Practical
Computer Graphics Practical
 
Leaky bucket algorithm
Leaky bucket algorithmLeaky bucket algorithm
Leaky bucket algorithm
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shaping
 

Ähnlich wie CG simple openGL point & line-course 2

02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipelineGirish Ghate
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architectureDhaval Kaneria
 
Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Jean-Philippe Doiron
 
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 6fungfung Chen
 
Fundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdfFundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdfMattupallipardhu
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeOfer Rosenberg
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGLGary Yeh
 
Create Amazing VFX with the Visual Effect Graph
Create Amazing VFX with the Visual Effect GraphCreate Amazing VFX with the Visual Effect Graph
Create Amazing VFX with the Visual Effect GraphUnity Technologies
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Dmitry Alexandrov
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesPooya Eimandar
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)mistercteam
 
Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Intel® Software
 
Siggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsSiggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsTristan Lorach
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Lviv Startup Club
 
Computer graphics - Nitish Nagar
Computer graphics - Nitish NagarComputer graphics - Nitish Nagar
Computer graphics - Nitish NagarNitish Nagar
 
01 intro-bps-2011
01 intro-bps-201101 intro-bps-2011
01 intro-bps-2011mistercteam
 

Ähnlich wie CG simple openGL point & line-course 2 (20)

Computer graphic lecturer no 3
Computer graphic lecturer no 3Computer graphic lecturer no 3
Computer graphic lecturer no 3
 
02 direct3 d_pipeline
02 direct3 d_pipeline02 direct3 d_pipeline
02 direct3 d_pipeline
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architecture
 
Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill) Developing Next-Generation Games with Stage3D (Molehill)
Developing Next-Generation Games with Stage3D (Molehill)
 
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
 
Fundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdfFundamentals of Computer Graphics.pdf
Fundamentals of Computer Graphics.pdf
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universe
 
OpenGL basics
OpenGL basicsOpenGL basics
OpenGL basics
 
Introduction of openGL
Introduction  of openGLIntroduction  of openGL
Introduction of openGL
 
Create Amazing VFX with the Visual Effect Graph
Create Amazing VFX with the Visual Effect GraphCreate Amazing VFX with the Visual Effect Graph
Create Amazing VFX with the Visual Effect Graph
 
What is OpenGL ?
What is OpenGL ?What is OpenGL ?
What is OpenGL ?
 
Java on the GPU: Where are we now?
Java on the GPU: Where are we now?Java on the GPU: Where are we now?
Java on the GPU: Where are we now?
 
Chapter-3.pdf
Chapter-3.pdfChapter-3.pdf
Chapter-3.pdf
 
The next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game EnginesThe next generation of GPU APIs for Game Engines
The next generation of GPU APIs for Game Engines
 
3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)3 boyd direct3_d12 (1)
3 boyd direct3_d12 (1)
 
Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)Introduction to Software Defined Visualization (SDVis)
Introduction to Software Defined Visualization (SDVis)
 
Siggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentialsSiggraph 2016 - Vulkan and nvidia : the essentials
Siggraph 2016 - Vulkan and nvidia : the essentials
 
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
Данило Ульянич “C89 OpenGL for ARM microcontrollers on Cortex-M. Basic functi...
 
Computer graphics - Nitish Nagar
Computer graphics - Nitish NagarComputer graphics - Nitish Nagar
Computer graphics - Nitish Nagar
 
01 intro-bps-2011
01 intro-bps-201101 intro-bps-2011
01 intro-bps-2011
 

Mehr von fungfung Chen

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 mediafungfung Chen
 
Tips for fulfilling patent application
Tips for fulfilling patent applicationTips for fulfilling patent application
Tips for fulfilling patent applicationfungfung Chen
 
Defending your Rights
Defending your RightsDefending your Rights
Defending your Rightsfungfung Chen
 
Polishing search skills
Polishing search skillsPolishing search skills
Polishing search skillsfungfung Chen
 
Inquiry Based Approach - Patent Search
Inquiry Based Approach - Patent SearchInquiry Based Approach - Patent Search
Inquiry Based Approach - Patent Searchfungfung Chen
 
Overseas protection & patent search
Overseas protection & patent searchOverseas protection & patent search
Overseas protection & patent searchfungfung Chen
 
Patentability classification search
Patentability classification searchPatentability classification search
Patentability classification searchfungfung Chen
 
Novelty to Nonobviousness
Novelty to NonobviousnessNovelty to Nonobviousness
Novelty to Nonobviousnessfungfung Chen
 
Patentability requirement on novelty
Patentability requirement on noveltyPatentability requirement on novelty
Patentability requirement on noveltyfungfung Chen
 
2012 Smart TV - Evolution & Approaches
2012 Smart TV - Evolution & Approaches2012 Smart TV - Evolution & Approaches
2012 Smart TV - Evolution & Approachesfungfung Chen
 
Patentability Requirements
Patentability RequirementsPatentability Requirements
Patentability Requirementsfungfung Chen
 
Working model to patentability
Working model to patentabilityWorking model to patentability
Working model to patentabilityfungfung Chen
 
Evaluate your invention
Evaluate your inventionEvaluate your invention
Evaluate your inventionfungfung Chen
 
how to invention & practice it
how to invention & practice ithow to invention & practice it
how to invention & practice itfungfung Chen
 
Digital converge - DTV service design
Digital converge - DTV service designDigital converge - DTV service design
Digital converge - DTV service designfungfung Chen
 
Hybrid digital broadcasting methods
Hybrid digital broadcasting methodsHybrid digital broadcasting methods
Hybrid digital broadcasting methodsfungfung Chen
 
Summary the challenges of Social TV
Summary the challenges of  Social TVSummary the challenges of  Social TV
Summary the challenges of Social TVfungfung Chen
 
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 9fungfung Chen
 
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 8fungfung Chen
 

Mehr von 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 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
 
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
 

Kürzlich hochgeladen

💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...sonalitrivedi431
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentationamedia6
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...RitikaRoy32
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...amitlee9823
 
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
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Delhi Call girls
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfParomita Roy
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
Government polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdGovernment polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdshivubhavv
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
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
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...home
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdftbatkhuu1
 
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
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Delhi Call girls
 
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...Call Girls in Nagpur High Profile
 
2-tool presenthdbdbdbdbddhdhddation.pptx
2-tool presenthdbdbdbdbddhdhddation.pptx2-tool presenthdbdbdbdbddhdhddation.pptx
2-tool presenthdbdbdbdbddhdhddation.pptxsuhanimunjal27
 

Kürzlich hochgeladen (20)

💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 
The history of music videos a level presentation
The history of music videos a level presentationThe history of music videos a level presentation
The history of music videos a level presentation
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
UI:UX Design and Empowerment Strategies for Underprivileged Transgender Indiv...
 
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
Jigani Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bangal...
 
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)
 
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
Best VIP Call Girls Noida Sector 44 Call Me: 8448380779
 
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdfChapter 19_DDA_TOD Policy_First Draft 2012.pdf
Chapter 19_DDA_TOD Policy_First Draft 2012.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
Government polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcdGovernment polytechnic college-1.pptxabcd
Government polytechnic college-1.pptxabcd
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
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 🔝✔️✔️
 
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
Recommendable # 971589162217 # philippine Young Call Girls in Dubai By Marina...
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
Editorial design Magazine design project.pdf
Editorial design Magazine design project.pdfEditorial design Magazine design project.pdf
Editorial design Magazine design project.pdf
 
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...
 
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
 
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...
 
2-tool presenthdbdbdbdbddhdhddation.pptx
2-tool presenthdbdbdbdbddhdhddation.pptx2-tool presenthdbdbdbdbddhdhddation.pptx
2-tool presenthdbdbdbdbddhdhddation.pptx
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 

CG simple openGL point & line-course 2

  • 1. Simple OpenGL Program (point & line) Chen Jing-Fung (2006/11/13) Assistant Research Fellow, Digital Media Center, National Taiwan Normal University National Taiwan Normal University
  • 2. Displayers • CRT & Flat-panel Display http://www.plasmadepot.com/plasmatv/plasmatv101.html 2
  • 3. CRT (Cathode ray tube) • Cutaway rendering of a color CRT Display Mask Anode connection Phospfor layer Deflection coils Focusing coils Electron beams Electron guns Close-up of the Phospfor layer 3 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • 4. TFT LCD (Thin Film Transistor Liquid Crystal Display) • TFT LCD has a sandwich-like structure with liquid crystal filled between two glass plates. 4 http://www.plasma.com/classroom/what_is_tft_lcd.htm
  • 5. PDP (Plasma Display Panel) • A plasma TV is sometimes called an "emissive" display — the panel is actually self-lighting. • The display consists of two transparent glass panels with a thin layer of pixels sandwiched in between. 5 http://www.plasmadepot.com/plasmatv/howplasmaworks.html
  • 6. What is different? • CRT – Electrostatic deflection of the electron beam • LCD – Back light module • PDP – Tiny colored fluorescent lights 6
  • 7. DIY your projector USD$200 Cutaway rendering of the projector Fresnel Lens Conventional Lens 5.5’’ LCD + VCD player = $169 USD http://en.wikipedia.org 7 http://www.audiovisualizers.com/madlab/lcd_proj.htm
  • 8. Basic video-controller refresh operations Horizontal and Vertical Raster-Scan Generator Deflection Voltage x Register y Register Memory Address Pixel Register Intensity Frame Buffer 8
  • 9. Frame Buffer • Cartesian reference frame with origin at the lower-left corner of a video monitor y x 9
  • 10. Coordinate representations Viewing & Projection Coordinates 1 1 Modeling 1 Video Monitor (local or master) Coordinates Plotter World Normalized (Cartesian) Coordinates Coordinates Other Output Device Coordinates 10
  • 11. • Coordinates: – Modeling (m), World (w), Viewing (v), Projection (p), Normalized (n), Device (d) • (xmc, ymc, zmc) -> (xwc, ywc, zwc) -> (xvc, yvc, zvc) -> (xpc, ypc, zpc) -> (xnc, ync, znc) -> (xdc, ydc) 11
  • 12. Graphs system • User program, Graphics system, I/O devices Function calls Output User Graphics I/O devices program system Data Input 12
  • 13. Application Programming Interface (API) Functions • Divide API functions into seven groups: – Primitive functions – Attribute functions – Transformation functions – Viewing functions – Input functions – Control functions 13
  • 14. Primitive & Attribute • Primitive functions - graphics output primitives – Character strings & geometric entities • Points, lines, areas and shapes (2D, 3D) • Attribute functions - Properties of the output primitives – Describe how a particular primitive is to be displayed • Color specifications, line styles, text styles and area- filling patterns … 14
  • 15. Viewing • Select a view of the scene -> type of projection -> location on monitor • Other routines: – Managing the scene display area • Specifying its position, size and structure • Identified visible objects and applied lighting conditions (3D) 15
  • 16. Software standards - GL • Graphics Library (GL) a widely used package in the graphics community – Goal: fast, real-time rendering and package was being extended to other hardware systems. – International Standard Organization (ISO) • Graphical kernel system (GKS) 1984 – 2D & 3D • Programmer’s Hierarchical Interactive Graphics Standard (PHICS) – Increase: object modeling, color specification, surface rendering… – PHICS+ (3D) 16
  • 17. Software standards - OpenGL • OpenGL : a hardware-independent version of GL in the early 1990s. • The graphics package is maintained and updated by OpenGL Architecture Review Board. • Language binding – C and C++ 17
  • 18. Other Graphics Packages • Graphics libraries – Java 2D (Java applets) – Java 3D – Mathematica – Matlab – Maple… 18
  • 19. Introduction to OpenGL • Overview OpenGL based on VC++ – http://dev.yesky.com/424/2080424.shtml • Basic OpenGL Syntax – Function names in OpenGL basic Library • Ex: glBegin, glClear, glCopyPixels… – Arguments in Function (interval: _ ) • Ex: GL_2D, GL_RGB, GL_POLYGON… – Specific data types • Ex: GLbyte, GLshort, Glint… 19
  • 20. OpenGL – Related Libraries • GL: basic core library (prefix: gl) • OpenGL Utility (GLU): (prefix: glu) – Setting up viewing and projection matrices – describing complex objects with line and polygon – Displaying quadrics and B-splines – Processing the surface-rendering operations – Other complex tasks 20
  • 21. OpenGL- Display window • OpenGL Extension: – X Window System (GLX) - Prefix: plX – Apple GL (AGL) - Prefix: agl – Microsoft Windows system (WGL) - Prefix: wgl – IBM OS/2 (Presentation Manager to OpenGL: PGL) - Prefix: pgl 21
  • 22. OpenGL Utility Toolkit (GLUT) – Provide a library of functions for interacting with any screen-windowing system. • Prefix: glut • Contain: describing and rendering quadric curves and surfaces • Download: (glut-3.7.6-bin.zip ~117 KB) http://www.xmission.com/~nate/glut.html 22
  • 23. How to Use GLUT? • Put 3 files from ``glut-3.7.6-bin.zip’’ in your project directory. – README-win32.txt • glut32.dll to %WinDir%System • glut32.lib to $(MSDevDir)....VC98lib • glut.h to $(MSDevDir)....VC98includeGL 23
  • 24. Setup for a OpenGL Program 1/5 • Microsoft Visual C++ 6.0 – Step 1: create a Win32 Console Application project 24
  • 25. Setup for a OpenGL Program 2/5 – Step 2:Press Alt-F7 project -> settings...->Link – Step 3:add opengl32.lib glu32.lib glut32.lib into Object/library modules 25
  • 26. Setup for a OpenGL Program 3/5 • Microsoft Visual C++ .Net – Step 1:create Win32 console project 26
  • 27. Setup for a OpenGL Program 4/5 – Step 2: select ―empty project‖ 27
  • 28. Setup for a OpenGL Program 5/5 – Step 3:select project->property…->linker -> input – Step 4: add opengl32.lib glu32.lib glut32.lib 28
  • 29. Header Files 2/1 • Include the header file the OpenGL core library – #include <windows.h> • With Microsoft Windows – #include <GL/gl.h> • Basic core library – #include <GL/glu.h> • Object-oriented toolkit & 3D application 29
  • 30. Header Files 2/2 • Use GLUT to handle the window-managing operations. – #include <GL/glut.h> • gl.h, glu.h (redundant and could affect program portability) • Need to include c++ code – #include <stdio.h> #include <stdlib.h> #include <math.h>… • ISO/ANSI standard for c++ – Include: cstdio, cstdlib and cmath 30
  • 31. Display-Window Management Using GLUT 2/1 • Initialization function – glutInit(&argc, argv); • Create display window (DW) and caption – glutCreateWindow(―An Example OpenGL Program‖); • Assign our picture to DW – Ex: describing a line segment – glutDisplayFunc(lineSegment); • But DW is not yet. More GLUT function -> complete the window-processing operations – glutMainLoop( ); <- the last line (check all input devices – mouse or keyboard) 31
  • 32. Display-Window Management Using GLUT 2/2 • Top-left corner of the video display (50,100) – glutInitWindowPosition(50, 100); • Display window of OpenGL: width=400 pixels and height= 300pixels – glutInitWindowSize(400, 300); 100 50 Display window 300 400 • A single refresh buffer & RGB mode – glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB) 32
  • 33. A complete OpenGL Program 2/1 • Set background color: white – glClearColor(1.0, 1.0, 1.0, 0.0); <- alpha value is as a ``blending’’ parameter. • Get the assigned window color displayed – glClear(GL_COLOR_BUFFER_BIT); • Set object color – glColor3f(1.0, 0.0, 0.0); 33
  • 34. A complete OpenGL Program 2/2 • OpenGL processes our picture (2D line) through the full 3D viewing operations – “project’’ – glMatrixMode(GL_PROJECTION); • Map rectangle – glOrtho2D(0.0, 200.0, 0.0, 150.0); • Cartesian endpoint coordinate – glBegin(GL_LINES); glVertex2i(180, 15); glVertex2i(10, 145); glEnd(); 34
  • 35. 35
  • 36. Display function User define 36
  • 37. Point Specification • OpenGL functions – glVertex*();<-The coordinate values – EX: glBegin (GL_POINTS); glVertex2iv (p1); //i: integer y glVertex2iv (p2); glVertex2iv (p3); glEnd (); p2 • C++ class or structure p1 p3 – Ex: Class wcPt2D { Public: wcPt2D pointPos; x GLfloat x, y; pointPos.x = 120.75; }; pointPos.y = 45.30; glBegin (GL_POINTS); glVertex2f (pointPos.x, pointPos.y); glEnd (); 37
  • 38. OpenGL Line functions glBegin (*); glVertex2iv (p1); glVertex2iv (p2); glVertex2iv (p3); glVertex2iv (p4); glVertex2iv (p5); glEnd (); p3 p3 p3 p1 p5 p1 p5 p1 p2 p4 p2 p4 p2 p4 Primitive line generated polyline generated Closed polyline generated with GL_LINES with GL_LINE_STRIP with GL_LINE_LOOP 38
  • 39. Line-drawing algorithms 2/1 • A straight-line segment in a scene is defined by the coordinate positions for the endpoints of the segment. • Line is compose of the nearest pixel positions along the line path between the two endpoints. • Ex: point (10.48, 20.51)->(10,21) 39
  • 40. Line-drawing algorithms 2/2 • The Cartesian slope-intercept equation for a straight line – y=m*x+b Dy Dx – slope m=(yend-y0)/(xend-x0) yend y0 – Intercept b=y0-m*x0 • Digital differential analyzer x0 xend Dx = 1, yk+1 = yk + m Dy Dy = 1, xk+1 = xk + 1/m Dx • Steps? yend ?? Dx = -1 ? or Dy = -1 ? yk 40 xk xend
  • 41. How to a parameter drawing line? National Taiwan Normal University
  • 42. Bresenham’s line algorithm 3/1 • Bresenham’s line is an accurate and efficient raster line-generating algorithm • Use only incremental integer calculations. • Determine at next sample point whether to plot. – The negative-slope line: if start point (50, 50), next point? • (51, 50) or (51, 49) 42
  • 43. Analysis Bresenham’s line algorithm • The scan-conversion process: – Set the positive slope < 1.0 and start point (x0, y0) – Let the kth step in this process, therefore, the displayed pixel (xk, yk) • Next pixel (xk+1, yk) or (xk+1, yk+1) – The sampling position xk+1, depend on (dlow- dup) • The label vertical pixel separations from dlow and dup • Pk=Dx(dlow-dup) is the same as the sign of (dlow- dup) – If yk ~ line, (dlow< dup), then pk< 0 – Next pk+1 ? yk+1 m – First parameter p0 ? yk 1-m xk+1 43
  • 44. Bresenham’s line algorithm 3/3(m<1.0) • Step 1: Input left endpoint (x0, y0) • Step 2: Set the color for frame-buffer position (x0, y0) • Step 3: Calculate Dx, Dy, 2Dy and 2Dy-2Dx – If yk+1>yk, p0=2Dy-Dx, else yk+1<yk, p0=2Dy+Dx yk+3 y = mx + b • Step 4: The decision parameter pk+1 yk+2 – If pk<0 & next point is (xk+1, yk) yk+1 y • pk+1= pk+2Dy yk – Else next point is (xk+1, yk+1) xk xk+1 xk+2 xk+3 • pk+1= pk+2Dy-2Dx • Step 5: return step 4 Dx-1 times yk+1 m yk 1-m xk+1 44
  • 45. Bresenham’s line example • Start point: (20, 10) • End point: (30, 18) 45
  • 46. Homework • HW 1: Draw line from (30, 150) to (200, 10) – Hint : line-drawing algorithm – If you use one decision parameter to do, you will get the reward. • HW 2: Plot the regular polygon (3, 4, 5, cycle) 46
  • 47. Two important points of Homework • Explain (30%) • Program (70%) 47
  • 48. References • .Net Education website: – http://yes.nctu.edu.tw/DotNet/index.ht m • Mathworld – http://mathworld.wolfram.com/ 48