Download presentation
Presentation is loading. Please wait.
Published byAmberly Preston Modified over 8 years ago
1
1 Projection: Completing the Camera Model ©Yiorgos Chrysanthou 2001, Anthony Steed 2002-2003
2
2 Summary n Up to now we saw how to create images using ray tracing
3
3 Ray Tracing n Very ‘realist’ images but n Very slow – not real-time © Copyright LightWork Design. Model courtesy of Real-Time Visualisation
4
4 Let’s accelerate by simplifying n Drop the global illumination part i.e no recursion n Drop the lighting, just ambient n Assume only polygons n Instead of tracing rays to each pixel, just trace them to the vertices and fill the space in-between n Instead of tracing the vertices, project them
5
5 Projection n Although much faster, it creates several new problems: Projecting the vertices Clipping to the view volume Visible surface determination Rendering a polygon in 2D Lighting Shadows Global illumination (Radiosity)
6
6 Full camera specification n We have already seen: VRP, VPN, VUV, COP, view plane window n Some more parameters: Viewplane Distance Type of projection –Perspective – all rays converge to the COP –Parallel – parallel rays from points in the scene (DOP) Front and back clip planes View plane window
7
7 Perspective Projection n In order to get a natural looking image we need the perspective n For a simple arrangement it is easy to find the projection Y
8
8 Canonical Frames n We use these as intermediate stages from which we know how to proceed n Canonical Frame for Perspective Projection: Cop at (0,0,-1) Viewplane coincident with U-V plane Viewplane window bounded by –1 to +1
9
9 Canonical Frame for Parallel Projection n Orthographic parallel projection n Direction of projection (DOP) is (0,0,-1) n View volume bounded by –1 and +1 on U and V n And by 0 and 1 on the N axis n p’ = (x, y, 0)
10
10 General Perspective to Canonical Parallel V N VRP=O COP VP truncated View Volume view window
11
11 General Perspective to Canonical Perspective n We will apply a set of transformation matrices (4 in total) n Each one ‘corrects’ a particular aspect of the projection n Then we put them all together to get one matrix
12
12 Step 1: move the view plane to the UV plane (n = 0) cop View plane d cop V N View plane V N
13
13 Step 2: translate the COP so that it lies on the N axis View plane V N View plane V N cop
14
14 Step 3: change the view volume into a regular pyramid N View plane V N cop V D D Where D = d – c z dx = x 2 – x 1 dy = y 2 – y 1 px = x 2 + x 1 py = y 2 + y 1
15
15 Step 4: Scale by 1/D N V cop 1 1 N V D D
16
16 We multiply all 4 matrices together to get (Q):
17
17 Canonical Viewing Space (Canonical Perspective) We can now compute T = MQ, where M maps WC to VC Q maps VC to canonical VC
18
18 The composite matrix T = MQ
19
19 Where the symbols mean:
20
20 Canonical Viewing Space to Canonical Parallel n Given a point in CVS n Result in CPS is
21
21 Towards Canonical Parallel n This step introduced the perspective projection D min D max
22
22 Front and Back Clipping Planes n Actually want Z between 0 and 1 n Replace P with
23
23 Recap n Moving away from Ray-Tracing to projection n Finalised a camera specification and looked at mapping General perspective Canonical perspective Canonical parallel n We’ll spend next couple of weeks tidying up problems! Clipping, lighting, visibility, etc…
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.