Multimedia Programming 2005 - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Multimedia Programming 2005

Description:

Animated movies. Special effects in standard movies (LOTR) What is computer 3D? Notes ... magnificent fireworks! Chocolate bar: really great fireworks. Notes ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 25
Provided by: lia9
Category:

less

Transcript and Presenter's Notes

Title: Multimedia Programming 2005


1
Multimedia Programming2005
  • Class 6
  • 3D

2
Course Notes
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Remember to hand in your assignment before 1700
    today!
  • Ill be assisting today on the Trivial Pursuit
    assignment.
  • This is the last class
  • Grades over e-mail.
  • Yesterdays e-mail.

3
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
4
Contents
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Notes
  • Introduction
  • Binocular vision
  • 3D recreation
  • Computer representation
  • Challenges
  • 3D programming
  • Assignment

5
Introduction
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Computer 3D images are NOT everywhere
  • 3D games
  • Animated movies
  • Special effects in standard movies (LOTR)
  • What is computer 3D?

6
3D perception
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Two types
  • Monocular hints
  • Binocular vision
  • Both employed within 3D visualization techniques.

7
Monocular hints
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Motion Parallax
  • Animals
  • Color vision
  • Perspective
  • Relative Size
  • Distance Fog
  • Occlusion
  • Focus

8
Binocular vision
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Stereopsis
  • Convergence
  • Disabilities
  • painters

9
3D representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Mostly employs monocular hints
  • Paintings or drawings
  • 3D text
  • Platform games
  • 3D games
  • Some binocular methods

10
3D representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Stereographic cards and viewers
  • Crossed-eye viewing
  • Transparency viewers (viewmaster)
  • Head-mounted displays
  • Glasses
  • Shutter
  • Polarized light
  • Two-color anaglyph

11
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Mostly uses the monocular hints methods.
  • Sometimes uses shutter glasses or head-mounted
    devices.

12
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Difference from 2D
  • Actual 3D model is stored in computer
  • Rendering to create 2

13
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Difference from 2D
  • Actual 3D model is stored in computer.
  • Rendering to create 2D image from current view.
  • 3D modelling ? sculpting
  • Rendering ? painting
  • Why were early days 3D graphics blocky?

14
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Popular techniques OpenGL and Direct3D
  • Large part of rendering done by hardware
    (accelerators).
  • 3 Step paradigm
  • Modelling
  • Scene layout Setup
  • Rendering

15
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Set form of the item or area
  • Set properties (texture, lighting, etc.)
  • Modeling techniques
  • Polygons
  • Constructive solid geometry
  • Subdivision surfaces
  • And more

16
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Scene setup prepare scene
  • Camera points
  • Light sources
  • Objects
  • Area
  • Sometimes key-framing (animation)

17
Computer representation
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Rendering convert 3D scene into 2D image at any
    time.
  • Compare with taking picture
  • Employs difficult mathematical techniques
  • Employs tricks like lens flares and motion blur
  • From wireframe to radiosity

18
Computer challenges
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Getting it done
  • Specifically
  • Textures like hair, skin, clothes
  • Fluids like water and blood

19
3D Programming
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • //load direct3D
  • g_pD3D Direct3DCreate9( D3D_SDK_VERSION )
  • //set parameters
  • D3DPRESENT_PARAMETERS d3dpp
  • ZeroMemory( d3dpp, sizeof(d3dpp))
  • d3dpp.Windowed TRUE
  • d3dpp.SwapEffect D3DSWAPEFFECT_DISCARD
  • d3dpp.BackBufferFormat D3DFMT_UNKNOWN
  • //create device
  • g_pD3D-CreateDevice( D3DADAPTER_DEFAULT,
    3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROC
    ESSING, d3dpp, g_pd3dDevice )

20
3D Programming
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • g_pd3dDevice-Clear( 0, NULL, D3DCLEAR_TARGET,
    D3DCOLOR_XRGB(0,0,255), 1.0f, 0 )
  • g_pd3dDevice-BeginScene() // Begin the scene.
  • // Rendering of scene objects happens here.
  • g_pd3dDevice-EndScene() // End the scene.
  • // show the scene
  • g_pd3dDevice-Present( NULL, NULL, NULL, NULL)
  • // cleanup
  • if( g_pd3dDevice ! NULL)
  • g_pd3dDevice-Release()
  • if( g_pD3D ! NULL)
  • g_pD3D-Release()

21
3D programming
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • struct CUSTOMVERTEX
  • FLOAT x, y, z, rhw // position for vertex
  • DWORD color // The vertex color.
  • define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHWD3DFVF_
    DIFFUSE)
  • CUSTOMVERTEX vertices
  • 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, ,
    250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, ,
    50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, ,

22
3D programming
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • g_pd3dDevice-CreateVertexBuffer(
    3sizeof(CUSTOMVERTEX),0, D3DFVF_CUSTOMVERTEX,
    D3DPOOL_DEFAULT, g_pVB )
  • VOID pVertices
  • g_pVB-Lock( 0, sizeof(vertices),
    (void)pVertices, 0 )
  • memcpy( pVertices,g_Vertices,sizeof(vertices))
  • g_pVB-Unlock()
  • g_pd3dDevice-SetStreamSource( 0, g_pVB, 0,
    sizeof(CUSTOMVERTEX) )
  • g_pd3dDevice-SetFVF( D3DFVF_CUSTOMVERTEX )
  • g_pd3dDevice-DrawPrimitive( D3DPT_TRIANGLELIST,
    0, 1 )

23
Assignment
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Deadline January 10th
  • Exercises practice with all sorts of 3D
    techniques
  • Employ one of them (matrices) to create some
    result
  • Create a magnificent fireworks!
  • Chocolate bar really great fireworks.

24
Last Assignments
Notes Contents Introduction Binocular
vision Recreation Computer representation Challeng
es 3D programming Assignment
  • Received a total of 9 programs
  • Questions go see me in my office
  • Results 3 (well) done.
  • Chocolate bar 3 Angelika Preissler AND Pieter
    Jordaan
  • Result for assignment 4 none yet
  • Chocolate bar 4 no results yet
Write a Comment
User Comments (0)
About PowerShow.com