Field of View
Field of View
In OpenGL, as in any graphics package, there exists a space inside which your data is displayed. In Partiview, this space is shaped like a pyramid. You are looking from the tip of the pyramid and everything you see in the Graphics Window is inside its walls. This pyramid can have a small height from base to apex, rendering it relatively flat, or its height can be large, rendering a tall, slender pyramid. The shape of the pyramid is set by the field of view command (fov).
In order to examine the field of view in Partiview, we are going to draw a sphere that is made up of latitude and longitude lines at 10o intervals, then look out from the center of that sphere. This is somewhat complicated, but provides a visual understanding of the field of view, as well as an introduction to drawing ellipsoids.
The ellipsoid data command is one of the more complex commands . Rather than get bogged down in that command now, we will draw a simple ellipsoid and explain the command in more detail later in this guide.
First, let's start Partiview without any data (or start with a data set pre-loaded and turn off all the data). We will draw a sphere around our Point of Interest that has a radius of 1000 units and vertices every 10o in both latitude and longitude. This is achieved via the command
add 0 0 0 ellipsoid -r 1000 -c 18 -s wire -n 36,19where we have chosen a color index of 18 (referring to the default color map), a wire-frame drawing style, the number of longitude lines to be 36, and the number of latitude lines to be 19 (this number includes the poles). This gives us a sphere with lines every 10o.
Now, change the clipping planes (we discuss this in the next section) to accommodate the sphere using the clip command
clip .1 100000and pull away so that you see the entire sphere.
Next, let's draw an object in the xy plane so we can easily see which line of latitude is the equator. The object we draw will be a flat, disk-shaped object with the z radius equal to zero. Draw this via the command
add 0 0 0 ellipsoid -r 1000,1000,0 -c 18 -s wire -n 36This places a round plane (Rx = 1000, Ry = 1000, Rz = 0) with 36 vertexes in the x and y directions, drawn with the wire style.
Now jump back to the Point of Interest using
jump 0 0 0and notice the bright white line along the equator (you may have to pan around a little). It's brighter because the two ellipsoids are drawn on top of one another. In the Fly Flight Mode, move the equator down so that it is at the bottom of your display. You may need to rotate it level (switch to Rotate Flight Mode and use the right mouse button) and switch back to Fly to move it down again.
Because these lines of latitude are in 10o intervals, you can count how many degrees the field of view is from the bottom of the Graphics Window to the top. The number of degrees from top to bottom should equal the value for the field of view. Let's be sure we know what the field of view is by setting it to 40 degrees using the command
fov 40Now you should count 40 degrees from top to bottom (you may need to pan a little to see all the lines).
Allowable values for the field of view range between (but are not equal to) 0o and 180o. If you change the fov to 90o, you should be able to see the pole and the equator (provided the pole is at the top of the Graphics Window and the equator is at the bottom). Obviously, this begins to distort the view pretty severely.
Let's load the Test Data by reading the test.cf file to see the effects on the data display. This will reset the field of view, but that's okay; we can check the current value, then turn the ellipsoids off using these commands:
add filepath [path to partiview]/data/mandata
read test.cf
fov
ellipsoid off
We see that the field of view is 50o. Also, you might have noticed that we didn't use the add command in front of the ellipsoid off command. This is actually a control command version of the ellipsoid command. We discuss the difference between these in “Spheres and Ellipsoids,” needless to say, ellipsoid off turns the ellipsoids in the active data group off. Use the ellipsoid on command if you wish to re-display them.
If you set the field of view back to 90o and, in Fly Flight Mode, pan around the sky, you will notice the distortion on the edges of the display. Change the field of view to something impractical, like 160o, then see the resulting effect. Finally, turn the ellipsoids back on and fly around to see the effects on the entire display.
© 2002-2005 American Museum of Natural History
Last Modified: 2006-04-28 by Brian Abbott
