projection and clipping n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Projection and Clipping PowerPoint Presentation
Download Presentation
Projection and Clipping

Loading in 2 Seconds...

play fullscreen
1 / 33

Projection and Clipping - PowerPoint PPT Presentation


  • 78 Views
  • Uploaded on

Projection and Clipping. 網媒所 林宏祥 2012.10.02. Overview. Orthogonal Projection. X. x camera. x viewport. -Z. Perspective P rojection. X. x camera. x viewport. -Z. d. z. View Volume—orthogonal projection. y. -z. x. Left C lipping Plane. Far C lipping Plane. Top Clipping Plane.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Projection and Clipping' - uttara


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
projection and clipping

Projection and Clipping

網媒所林宏祥2012.10.02

slide3

Orthogonal Projection

X

xcamera

xviewport

-Z

slide4

Perspective Projection

X

xcamera

xviewport

-Z

d

z

slide5

View Volume—orthogonal projection

y

-z

x

Left Clipping Plane

Far Clipping Plane

Top Clipping Plane

Bottom Clipping Plane

Near Clipping Plane

Right Clipping Plane

slide6

View Volume—Perspective projection model

y

-z

x

Left Clipping Plane

Far Clipping Plane

Top Clipping Plane

Near Clipping Plane

Bottom Clipping Plane

Right Clipping Plane

in o pengl the clipping cuboid is fixed
In OpenGL, the clipping cuboid is fixed.

(Since the screen size is fixed)

slide10

Clipping Cuboid: enclosed by:

xviewport= 1,xviewport=-1,yviewport=1,yviewport=-1,zviewport =1,zviewport=-1

Y

x

z

slide14

Orthogonal Projection

X

xcamera

xviewport

-Z

some scaling

a canonical view
A canonical view..

Clipping cuboid

Viewing Volume

1

left

right

-1

xviewport

0

xcamera

slide18

gluPerspective(fovy, aspect, zNear, zFar)

Left Clipping Plane

Far Clipping Plane

Top Clipping Plane

Near Clipping Plane

Bottom Clipping Plane

Right Clipping Plane

slide20

Perspective Projection

X

X

xcamera

xcamera

xviewport

xviewport

-Z

-Z

d

d

= 1

z

z

some scaling

a canonical view1
A canonical view..

Y

-zFar

-zNear

ycamera

fovy

zcamera

-Z

slide22

Y

-zFar

-zNear

ycamera

fovy

zcamera

-Z

slide23

Y

-zFar

-zNear

ycamera

fovy

zcamera

-Z

After projection, the boundaries should map to 1, -1

slide25
Mapping on z: To present more details in closer objects, the viewport coordinate is inverse proportional to camera coordinates.
slide28

Remember perspective projection?

(xcamera, ycamera coordinates will be divided by zcamera)

slide31

You need to create your own clipping cuboid which is different from openGL clipping cuboid. NOT modify the viewing volume.

(eg: xviewport: [-0.5,0.5], yviewport:[-0.5,0.5], zviewport:[-0.5, 0.5])

You need to adjust the coordinates in glVertex3f()

you need to calculate intersection
You need to calculate intersection

In 2D example,

screen

One capable way to handle it: Cohen-Sutherland Algorithm