Warp

Section: User Commands (1)
Updated: October 18, 1992
Index Return to Main Contents
 

NAME

warp - Geomview external module for deforming objects.  

SYNOPSIS

        warp
 

DESCRIPTION

Warp is a Geomview external module allowing the user to interactively deform OOGL objects through the movement of a group of control points. Warp runs on Silicon Graphics and Next workstations.

To warp an object, first start warp as a Geomview external module (See Geomview(1) and Geomview(5)). In Geomview, turn world normalization off and center all the objects. In warp, on the field marked "Object to warp:" enter the name of the object which you wish to deform. By default, this field is set to "g1." You will also need to create control points to manipulate the object. The easiest way to do this is to press the button marked "Position on Grid" in the Control Points section of the main panel. A 3x3x3 grid of cubes should appear around the object. These cubes, called "widgets," represent the locations of the control points.

To deform the object, move one of the cubes in the standard Geomview fashion (ie translate it). Now press the button marked "Warp." The object should change slightly. If you moved a control point far from any of the vertices of the object or if you did not move the control point particularly far, the change may not be very noticeable. If you have completed these steps successfully, you have the basics down.

You may want to position control points in other locations than on a grid. Press the "Create on pick" button. Now, every time you pick and object in Geomview by moving the cursor over it and pressing the right mouse button, a control point will be created. These control points may be used alone or in addition to a grid.

The preview button in the main panel is used to get a quick look at what the warped object will be. It will create an object in Geomview called "preview" which is identical to what the object will look like once it is warped. When the "Preview" button is used instead of the "Warp" button, the object is not replaced, the control points are not updated, and no intermediate files or steps are created (Intermediate files and steps will be discussed soon).

You may wish to move an existing control point to a new location without warping the object. To do this, select the control point from the list of control points in the warp panel (NOT the list of geoms in the Geomview panel) and press the "Edit point..." button. A panel will pop up showing the current location. You may set the x, y, and z coordinates in the panel by hand, or read the current location of the control point in Geomview by pressing the button marked "Read Current Location." Press the "Set" button to set the widget to the location shown in the panel.

The "Strength" and "Stretchiness" sliders on the panel control the strength of the control point and the stretchiness of the material. If the material does not seem to be responding to warping, set either the strength or the stretchiness higher. If the stretchiness value is set too high, the object may form sharp kinks when warped. When the program starts, these parameters should be set to reasonable values and generally will not require adjustment.

Clicking the button marked "Options..." brings up the options panel. The options panel allows control of the intermediate steps in the warping process. These steps are generally used to create animations or to show the continuous transformation of the object. If the option marked "Send to Geomview" is selected, the intermediate steps will be sent to Geomview so that the progression may be observed. If the "Retain All Steps" button is pressed, the intermediate steps sent to Geomview will all accumulate instead of being replaced by later steps. You probably will very rarely need this option.

Intermediate steps may also be sent to files by selecting the "Save to files" option. The file prefix and path may also be specified. The steps will be numbered from "Starting step" to "Ending step." If the "Update automatically" option is selected, these figures will be updated by warp every time the "Warp" button is pressed. Once the intermediate steps have been saved to a file, they may be played back as an animation or used for single-frame recording.

The widget size and geometry may also be changed using the options panel. If you think the widgets are too big or too small or that little cubes are obnoxious, update the appropriate fields in the "Widgets" section of the options panel. You may also ask to have the widgets scaled relative to the object you wish to warp. Note that this option may take a few seconds to apply.

Using the controls in the "Control Point Grid" section of the options panel, you may control the dimensions of the grid of control points that will be created when you press the "Position on grid" button on the main warp panel. Pressing the "Position Control Points" button on the options panel will have the same effect.

Warp also supports several lisp commands which may be used to control its basic actions. These commands will generally be sent to warp through Geomview using the (emodule-transmit) command. (create-widget (x y z [w])) creates a widget at the given location. (create-widget-grid [(x y z)]) produces the same results as pressing the "Position on Grid" button. If x, y, and z are present, they replace the current grid dimensions specified on the options panel of the user interface. (delete-widget [name]) deletes a widget. If name is not specified, all widgets are deleted. (preview [name]) gives the same results as pressing the "Preview" button. If present, name replaces the "Object to warp" field in the user interface. The behavior of (warp [name]) is similar, except it reproduces the results of the "Warp" button. Calling the (exit) function is the same as pressing the "Quit" button.  

DETAILS OF OPERATION

Warp uses the pointlist library (see pointlist(3)) to change the location of the points in the object to be warped. Each point is moved using the following formula:

weightsum = 0.0
displacementsum = (0, 0, 0)
for each control point {
        old = control point's original location
        new = control point's new location
        displacement = (new.x - old.x, new.y - old.y, new.z - old.z)
        dist = distance from old to location of point in target object
        compute the weight of the point using the formula 
                weight = strength * E^(-(dist * stretchiness)^2)
        displacement *= weight
        displacementsum += displacement
        weightsum += weight
}
displacementsum /= weightsum
new location of point on object = old location of point on object +
displacementsum
This algorithm is loosely based on that described in the paper "Feature Based Image Metamorphosis" by Thaddeus Beier and Shawn Neely (SIGGRAPH '92).

If the object to be warped is an inst with multiple appearances of the base geom, the first appearance will be warped and then used to replace the base geom.  

TROUBLESHOOTING

 

The Control Points aren't near the object!

Make sure the control points and the object to be warped are in the same coordinate system. First, try centering the object to be warped. If that does not work, try centering the entire world (by pressing "W" in Geomview).  

With the control points on the object, things aren't positioned

 

where I can work with them!

Move the entire world or fly the camera around until things are positioned the way you like.  

The object didn't change at all!

Make sure the "Object to warp:" field is set to the right thing. Note that it may not be set to "World" or "worldgeom." If you set it to "targetgeom," make sure that you did not inadvertently warp one of your control points which you left as the current Geomview target object. Also, the object may have changed, but not enough to be visible. Try moving the control points farther. Also, the control points all can be imagined as tugging at the object. If there is only one control point, the result will be a translation of the object.  

The control points are the wrong size!

Use to options panel to change the field marked "Widget Size." You may want to set the "Size relative to object" field.  

It core dumped!

Send e-mail to the author.  

SEE ALSO

geomview(1), geomview(5), pointlist(3)  

AUTHOR

Celeste Fowler                  email:  fowler@geom.umn.edu
The Geometry Center             phone:  (612) 626-8304
1300 South Second Street
Minneapolis, MN  55454


 

Index

NAME
SYNOPSIS
DESCRIPTION
DETAILS OF OPERATION
TROUBLESHOOTING
The Control Points aren't near the object!
With the control points on the object, things aren't positioned
where I can work with them!
The object didn't change at all!
The control points are the wrong size!
It core dumped!
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 01:36:55 GMT, December 05, 2024