View or Image Plane

[ LiB ]

View or Image Plane

In any scene one major component is the observer (or camera). The observer is basically the person who stands and looks at the 3D world from different viewpoints and orientations. The problem for us is that we need to save the information about what is being observed to a medium such as the monitor or a file. In Chapter 2, I said that to be able to view the 3D world you must first project it onto a 2D medium such as the monitor. Rendering whatever is seen from the eyes of the observer is then gathered onto something called the view plane (or image plane ). The computer monitor becomes the eyes of the observer. Whatever the monitor conveys is exactly what the observer is looking at in the 3D world. The monitor is commonly referred to as the view/image plane because of this premise . Now you may be thinking to yourself, why do we even need an image plane? The answer is that it was invented with the same idea of how a camera takes a picture.

To better explain this idea, take a look at Figure 5.2. What you see is something called the pinhole camera . The device is set up with a simple closed box with one tiny hole in the front face. As discussed in Chapter 3, light always takes the most guaranteed path to travel to its destination. It will bend if needed to get the job done. The picture is rendered correctly because the light pierces through this tiny hole, hitting the image plane on the opposite side of the box. As each photon hits the image plane this creates the picture. The pinhole idea was created to prevent film on the image plane from becoming overexposed .

Figure 5.2. The pinhole camera.

graphic/05fig02.gif


Similarly, this same image plane is used in computer graphics. This image plane is like looking through a window. If you're standing by the window and move your position around the room a little, you would be constrained to whatever the window shows. Basically the requirement for a virtual window must be utilized to perceive the 3D world. The image plane can be a 4x4 pixel breakdown of a tiny LCD screen or it can be an 800x600 image on the monitor. The bigger the image plane is, the longer it takes to render because you increase the number of pixels per each scan line in the image. The image plane is a red, green, and blue component buffer of colors that programmers apply to their scene class. The correct color information must be calculated for every point in the scene. This calculation becomes more intense if you are working with lots of different colors. High color modes such as 16-bit color (65,536 possible colors) or 24-bit color (16.7 million possible colors) can take a very long time to render as opposed to 256 colors in the old days of rendering. See Figure 5.3 for an example of the view plane.

Figure 5.3. View or image plane of a sim ple scene facing one sphere and one rec tangle.

graphic/05fig03.gif


NOTE

NOTE

Did you know that Hakan Lans was the inventor of computer color graphics and the computer mouse? He is a Swedish inventor who has over 40 patents.He's also responsible for the STDMA satellite navigation system that is the world standard for aviation and mar itime industries.Talk about genius,yet so few people know his name .

The image plane records the projected color information of the world seen through the eyes of the observer. This solves the problem of how one sets up a rendering environment to view something if there are infinite positions and orientations to perceive it. Each pixel of the monitor is a breakdown of the color information stored on the image plane, which provides us with a practical way to define a finite instance of visualization within a world of infinite possibilities.

This is how you define an 800x600 view plane in your application:

 The top side of the rectangle is: 0  The left side of the rectangle is: 0  The right side of the rectangle is: 800  The bottom side of the rectangle is: 600 

Here's the code to do this:

 RECT    ViewPlane = { 0, 0, 800, 600 }; 

[ LiB ]


Focus On Photon Mapping
Focus On Photon Mapping (Premier Press Game Development)
ISBN: 1592000088
EAN: 2147483647
Year: 2005
Pages: 128
Authors: Marlon John

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net