powerflip(6D)
powerflip - spin 3D objects in a window
As shipped in IRIX 6.5. First release of IRIX 6.5.
NAME powerflip - spin 3D objects in a window SYNOPSIS powerflip [-rsSCwWLRDh] [-B blurfactor] [-Fdensity] [-f r,g,b] [-T title_message] [-m material,backmaterial] [-p x,y,z] [-o q1,q2,q3,q4] [-c r,g,b] [-b backgroundfile] modelname [ modelname... ] DESCRIPTION powerflip is a replacement for the 'flip' demo, which was a replacement for the 'spin' demo. It will read 3D models from the named files, searching first for the model in the current directory and then in the /usr/demos/General_Demos/powerflip/data/ directory. If given a model argument of '-', .I powerflip will try to read a 3D model from standard input. See the YAODL(6d) manual page for a description of the 3D models' file format. Interaction powerflip can use either the mouse or a SpaceBall to control the position and orientation of the models. If a SpaceBall is connected to your system, it will be automatically used (you may still use the mouse, though). The left mouse button controls all of the currently selected objects' x/y translation. Holding down the button will stop an object from spinning and make it (roughly) follow the mouse's motion. The middle mouse controls all of the currently selected objects' rotation. The interface is a 'virtual trackball', centered at the center of the window. Essentially, the interface emulates a track-ball at the center of the window, with the modification that circular motions near the edge of the window are interpreted as z-rotations. When the middle mouse button is let up, the last spin direction is maintained; this lets you 'throw' objects. It is a lot easier to use than it is to describe. Holding down the left and middle mouse buttons together will control all selected objects' z-translation (zoom). The clipping planes are set fairly close to the objects; be careful not to lose them by zooming them too far. The right mouse button will bring up a rather elaborate series of rollover menus. They are described below. Objects Each object will have its own entry on the main menu. The following properties of objects may be changed: Move with Mouse Each object may be individually selected or deselected. Initially, the first object specified on the command line is the only one selected. If you deselect everything, powerflip will ignore the left and middle mouse buttons. Draw Transparent If your machine supports blending, this option will blend the object with whatever is underneath it, giving a transparent affect. If the object is displayed as wireframe, then this option will display the lines anti-aliased. Draw anti-aliased If brought up in wireframe mode (see the '-w' option in the list of command line options below), this option will replace the 'Draw Transparent' entry, and allows the lines to be drawn anti-aliased. Object Materials This rollover menu allows you to assign a material to an object. Initially all objects are a pewter-like material. Display Performance This options turns on or off a display of the number of polygons drawn (if polygonal objects are being displayed), then number of frames drawn per second, and the number of polygons drawn per second (again, if polygonal objects are being displayed). The numbers are updated every 30 frames drawn, and will not be accurate if any time was spent displaying popup menus, if the window was stowed, etc. Also note that only frame rates are reported for objects consisting of triangle meshes, nurbs, etc. Move Wireframe If this option is selected, the objects will be displayed as lines when they (or anything else in the scene) are moving, and will be displayed as solid objects when the scene is still. This is useful on slower machines that can draw lines faster than polygons (but note that the lines are still lit by the light sources in the scene). Lights Unless powerflip is brought up in no-lighting mode (see the command-line options section below), this set of menus allows you to modify the lights that affect the objects in the scene. Sources There are 8 light sources, arranged at the corners of a cube. Four of these sources are defined to be local lights, and four are infinite lights. This sub-menu lets you turn lights on and off. powerflip starts with one infite white light turned on. Lighting Models A lighting model can either assume the viewer is infinitely far away from the scene, in which case all light rays hitting a surface and bouncing towards the viewer are parallel, or a lighting model can be based on a viewer that has a specific location near the scene ("local viewer") in which case all light rays converge on the viewer after hitting a surface. The "local viewer" lighting model is more correct, but it is also computationally more complex, which causes a performance degradation. For most models, the visual difference between the two lighting models is very subtle. Move with Mouse This option allows you to change the position and orientation of the lights. You can't move the lights independently (they all move together), but you can move the lights independent of the object by deselecting the objects (by choosing the 'Move with Mouse' menu entry on each object's menu) and then choosing this menu entry. Fog If your machine supports it, this set of rollover menus allows you to control fog paramaters. Clear Air Choosing this entry (the default) turns off fog effects, setting fog density to zero. Fog This sets the fog color to grey, and, if the fog density was zero, it resets it to be moderately foggy. Haze Simulate haze by setting the fog color to a blue-grey color. Again, if the fog density was zero it is reset to be moderately hazy. Black Fog (depthcue) By setting the fog color to black, an effect called 'depth cueing' is achieved, where the farther away an object is from the eye, the darker it is. Density This submenu allows you to choose the fogginess of the scene, from 0.0 (which turns fog off and gives clear air), to 1.0 (so foggy you probably won't be able to see anything). Motion Blur If your machine has hardware support for an 'accumulation buffer', powerflip will optionally motion blur objects as they move. The effect is greatly exaggerated here for demonstration purposes; a real application would make the effect much more subtle. Note that powerflip automatically does full-scene anti-aliasing when the scene is still on machines with hardware accumulation buffers. Clipping Planes If your machine supports arbitrary clipping planes, this option lets you turn one on. Parts of objects on one side of the clipping plane will be displayed transparently; the other side will be displayed solid (the objects must be drawn twice to achieve this), unless the object is drawn in wireframe; in that case, half of the object will be drawn with anti- aliased lines, and half with non-anti-aliased lines. You can control the clipping plane's orientation and position with the mouse if you select the 'Move with Mouse' option; initially the clipping plane is given a random spin. Select All This entry will show up only if you have chosen more than one object; choosing it will select all objects (but it does not affect the lights). Exit Quit the program. The ESC key will also make the program exit. COMMAND LINE OPTIONS -s Everything will be still if this object is given; objects will not get a random rotation, and will come up in the same position and orientation every time. -S Stereo mode. powerflip will open up a full-screen window and put the system into 120HZ stereo mode. You can use the up and down arrow keys to control the eye separation of the stereo projection (up increases, down decreases). The system is put back into normal video mode when powerflip exits (unless it is somehow terminated abnormally; for example, by the 'kill' command). -C Turns clipping plane on by default. The clipping planes are normally off. -w Draw all models in wireframe (line) mode. -W Turn on move wireframe mode by default. The scene will be drawn as lines when anything in the scene is moving. -L No lighting mode. All lighting commands and popup menus will not appear. The default color for all objects will be white. This option is useful in conjunction with the -w command, to draw models as plain, unlit lines. -B number Turns on motion blur, with the given number used to set how much to blur (larger numbers blur more). -F density Sets the initial fog density. -f red,green,blue Sets the initial fog color. -m material[,backmaterial] Gives objects the given material by default. The number corresponds to one of the materials in the 'Materials' menu; the default is 3. If backmaterial is given, and your machine supports two-sided lighting, it will be used as the material for back-facing polygons. Note that many of the models in the /usr/demos/General_Demos/powerflip/data directory do not have correctly oriented polygons, so specifying a back material will result in incorrect results. Three models that do have correctly oriented polygons are 'nurb.ydl', 'xlogo.ydl' and 'can.ydl'. -T message The given message will be displayed while loading the data files. Several -T arguments may be given to display several lines (but long lines are not automatically wrapped). -b file Use the given file as a background image. Backgrounds are drawn in a coordinate system of -1.0 to 1.0 in both the X and Y directions. See /usr/demos/General_Demos/powerflip/data/background[1234].defs for examples of simple backgrounds. -R This option causes powerflip to be the 'root' window, the window that is always underneath all other windows. Unless you can afford the CPU time, it is best to use this option along with the -s option. No interaction is allowed when in this mode. -p x,y,z Sets the initial position of objects. When experimenting with this option, keep your initial guesses in the range of -2.0 to 2.0 or you might lose your objects. -o q1,q2,q3,q4 Sets the initial orientation of objects. The 4 numbers represent a quaternion rotation. To convert from an axis and an angle into a quaternion, use the following formulas: Given axis x,y,z and angle a (in radians), q1=x/sin(a/2), q2=y/sin(a/2), q3=z/sin(a/2), q4=cos(a/2). Ok, so you probably want to know why I would make you specify this as a quaternion. The reason is because powerflip represents rotations as quaternions internally, and it is easy to position the model and then use the debugger to dump out the quaternions value. I apologize, and maybe I'll fix it sometime... -c red,green,blue Specifies the background color for the window. The default background color is black (0.0,0.0,0.0). Colors range from 0.0 to 1.0. -r This (not very useful) option will cause the scene to be constantly be redrawn, even when nothing is changing. Normally powerflip will notice when nothing is changing, and will wait for user-input events and not consume any CPU time. -D Debug mode. Another not-very-useful option that brings up powerflip in a fixed-size window, and keeps it from forking off a process and freeing up the program it was invoked from. -h Help; prints a short list of all the command-line options available. FILES /usr/demos/General_Demos/powerflip/data/ data files & texture maps for powerflip SEE ALSO YAODL(6D) BUGS Anti-aliased lines are not drawn properly for many of the models because edges shared between polygons are drawn twice. Two models that do not have this problem are 'f15_wire.ydl' and 'can.ydl'.