A Modeler Plug-in for LightWave3D
Ver 2.10
Manual
(C)1999 Hiro Otsuka

Table of Contents


About PointFit

The PointFit plug-in transforms objects on foreground layers based on objects on background layers. The primary goal of this plug-in is to fit a set of subdivided polygons to a human body so as to create a model of clothes. However, the plug-in transforms foreground objects by a point-by-point basis, there is a wide variety of applications up to your imagination.

History

September 3, 1999 Version 1.00 Initial release
November 2, 1999 Version 1.10 The ZoomTarget parameter was added.
November 16, 1999 Version 2.00 The Fit mode and the Magnet parameter were added. The plug-in's internals were considerably changed and memory usage has enlarged.
The OverMove parameter was added.
The ForceMove parameter was added.
November 21, 1999 Version 2.10 The ForcePlus parameter was added.
The effect of the FallOff parameter was modified.
The NotBack parameter was added.
The ForeGround parameter was added.
The ZoomTarget parameter was renamed `ZoomPolygon'.

Requirements

This plug-in supports LightWave3D for Intel only.


An Overview of Parameters

Mode:
This parameter specifies the way of transforming foreground objects based on background objects. There are 4 modes: Flat, Pipe, Ball and Fit.
Magnet: (for the Fit mode only)
This parameter specifies the amount of magnetic power that background objects have. Each point of a foreground object is attracted to the nearest polygon of a background object.
Axis: (for the Flat and Pipe modes)
This parameter specifies the axis of transformation. The directions of points to be moved are determined by this parameter.
CenterX, CenterY, CenterZ: (for the Pipe and Ball modes)
This parameter specifies the point toward which the points are moved. The Pipe mode needs two center points, while the Ball mode requires three center points.
Direction:
This parameter specifies the direction toward which the points are moved. This parameter can be used in all modes.
Thickness:
This parameter specifies the imaginary thickness of background objects. This parameter can be used to prevent the points of foreground objects from getting stuck into background objects.
NotBack:
This parameter inhibits the points of foreground objects from "stepping back" from the original positions due to the Thickness parameter.
ZoomPolygon:
This parameter enlarges each polygon forming a background object horizontally, modifying the way of collision detection.
ForeGround:
This parameter changes the meaning of the ZoomPolygon parameter completely. By enabling this parameter, the plug-in enlarges the polygons of foreground objects three-dimensionally (without using background objects as a basis of transformation). Giving a minus value to the ZoomPolygon parameter scales them down.
OverMove:
This parameter reverts points that have gone too far to their original positions (this problem may happen in the Fit mode).
ForceMove:
The plug-in usually does not move points such that have no collisions with background objects. This parameter forces such a point to move based on the amount of movement of other moved points that belong to the same polygon.
ForcePlus:
The value of this parameter is multiplied by a value according to a distance and added to the value of the ForceMove parameter. The value of this parameter is simply added to the value of the ForceMove parameter if the value of the FallOff parameter is 1.0.
FallOff:
This parameter alters the value of the ForceMove parameter based on a distance from points that have moved.


The Details of Parameters

Mode

This parameter specifies the way of transforming points.

The Flat mode moves the points of foreground objects two-dimensionally. The way of each foreground point is determined by the Axis and Direction parameters. That is, a foreground point moves along the axis specified by the Axis parameter, to the direction from plus to minus if the Direction parameter is "+" while to the opposite direction if the Direction parameter is "-". The direction of movement is the same for all points.

The Pipe mode moves the points of foreground objects cylindrically. The center on which the points might converge is specified by the Axis parameter, the two of three parameters CenterX, CneterY and CenterZ, and the Direction parameter. That is, a foreground point goes toward the axis specified with the Axis parameter and the two of three parameters CenterX, CenterY and CenterZ. The point moves toward the axis if the Direction parameter is "+", while it goes away from the axis if the Direction parameter is "-". Two points move toward the same point if their coordinates are the same in terms of the two axes other than the specified axis.

The Ball mode moves the points of foreground objects spherically. The center on which the points might converge is specified by the three parameters CenterX, CenterY and CenterZ, and the Direction parameter. That is, a foreground point goes toward a center point specified with CenterX, CenterY and CenterZ. The foreground point moves toward the center point if the Direction parameter is "+", while it goes away from the center point if the Direction parameter is "-". The directions of two points differ if the points are at different positions.

The Fit mode moves the points of foreground objects so that the foreground objects are scaled down. The direction of each foreground point is determined by the Direction parameter only. Foreground objects are reduced if the Direction parameter is "+", while they are enlarged if the Direction parameter is "-". The direction of each foreground point is automatically computed. So, you need to tailor foreground objects to some extent in advance to fit them to background objects successfully.

Magnet

This parameter makes sense only in the Fit mode. When a value greater than zero is specified, each point of a foreground object being reduced is attracted to the nearest polygon of a background object. The modified destination of the foreground point is calculated by adding the vector to the nearest polygon of the background object to the vector to the original destination to which the foreground point would be transferred if the magnetic power did not affect at all. If the value 1.0 is specified, the foreground point will go straight toward the nearest point of a background object. Foreground objects can be well fitted to background objects even when the shapes of those objects differ considerably, although the results may go wrong in some cases.
In the left figure, blue arrows represent the original directions of foreground points. If the magnetic power of background objects is zero, a foreground object donated by black lines will be simply reduced and some points may not be fitted to any points of background objects donated by brown lines.

If a value is specified to the Magnet parameter, the magnetic power of background objects donated by green arrows is added to the original directions donated by blue arrows. So the original directions of foreground points result in the directions donated by red arrows. The value of the Magnet parameter specifies a magnification rate of this magnetic power.

By giving an extremely large value to this parameter, foreground points can be forced to go straight toward the nearest polygon, although in some cases neighboring points of a foreground object are fitted to the same point of a background object.

Axis

This parameter can be used in the Flat and Pipe modes. The directions of foreground points to be moved are determined based on the axis specified by this parameter. The effects of this parameter are different between the two modes. In the Flat mode, the axis represents the direction to which the points of foreground objects are shifted. In the Pipe mode, on the other hand, the axis represents the center line toward which the points of foreground objects would converge.

The difference of effects (the Axis parameter = "Y")
In the Flat mode
In the Pipe mode

CenterX, CenterY, CenterZ

These parameters can be used in the Pipe and Ball modes to specify the direction to which the points of foreground objects are moved. In the Pipe mode, two coordinates should be given to those axes other than the axis specified with the Axis parameter. These two coordinates define a point on the axis specified with the Axis parameter, and foreground objects are transformed so as to converge to the center line that is defined by the axis and positioned by the point. In the Ball mode, on the other hand, all three coordinates should be given to the three axes, which define the center point the points of foreground objects would converge.

Direction

This parameter can be used in all modes. The plus sign "+" means a normal direction, while the minus sign "-" does the opposite. For more detailed meanings of this parameter, see the description of the Mode parameter.

Thickness

This parameter can be used in all modes. It specifies an imaginary thickness of background objects. Note that this parameter actually specifies how much a point will be drawn back from its original destination. So, a polygon of a background object may be less thick than specified if the point fits aslant to the polygon.
Suppose that we give 5cm of thickness to a background object (donated by the brown line). If the thickness of the background object were actually 5cm, the purple line would be the line on which foreground points are fitted.

Now, suppose that the red dot is moved along the green arrow toward the position of the blue dot. In the PointFit plug-in the thickness parameter means the amount that a foreground point (the red dot) is moved back from the original destination (the position of the blue dot), so the red dot is moved back 5cm to the opposite direction of the green arrow, and fitted into the position of the black dot. As a result, the point is placed inside the background object whose thickness is represented by the purple line.

This effect of the Thickness parameter was designed so as to avoid a situation such that a foreground point fitted onto a background polygon from an extremely acute angle would be drawn back too far from the original destination.

NotBack

This parameter can be used in all modes, but does not make sense if the Thickness parameter is 0. When this parameter is turned on, a foreground point is not moved if the point is moved backward due to the Thickness parameter. By turning the NotBack parameter off and giving a suitable value to the Thickness parameter, you can get apart from background object such foreground points that are too near to the background objects. But, results may not be acceptable in some cases. Try turning on this parameter in such cases.
Suppose that the left figure shows a crotch part of pants, and two foreground points (the red ones) are fitted to a background object (the brown line) at the positions of the blue points respectively. Depending on values of the Thickness parameter, these foreground points can be fitted at the positions of the black points which are in back of the original positions of the foreground points. In cases that foreground points are backwardly moved and get across, the foreground objects the points belong to also get across. If the NotBack is turned on, foreground points stay at their original positions in such cases. Situations like this example often happen in the Fit mode.

ZoomPolygon

This parameter can be used in all modes. When a value is given to the ZoomPolygon parameter, PointFit horizontally scales up each polygon forming a background object. In the PointFit plug-in, polygons that are not a triangle polygon are subdivided into smaller triangle polygons. The horizontal magnification is done before polygons are subdivided into triangle ones. This scaling up is implemented by putting points of a background object at a distance specified in the ZoomPolygon parameter from the center of each polygon of the background object.
The left figure illustrates polygons that are horizontally scaled up. In contrast to three-dimensionally enlarged polygons, horizontally enlarged polygons can get many "sticking out" parts if the polygons make an acute angle. So, foreground points can be fitted at positions where there seems to be nothing. Try giving the value 0 to this parameter if the results seem wrong. This parameter is useful in the Flat mode and in cases that you want to fit points to background objects having a geometrical shape. Care may be needed if background objects contain a non-flat polygon.
Before applying ZoomPolygon After applying ZoomPolygon

ForeGround

This parameter can be used in all modes, but does not make sense if the ZoomPolygon parameter is 0. This parameter changes the meaning of the ZoomPolygon parameter. If the ForeGround parameter is turned on, foreground objects are three-dimensionally scaled up to the amount specified in the ZoomPolygon parameter. So, you don't have to specify any background objects if the ForeGround parameter is turned on.

Please note that foreground objects are scaled down if the Direction parameter is "+", and scaled up otherwise. Also, magnification is done in the usual manner if the ForeGround parameter is used in a mode other than the Fit mode.

This parameter is added in order to provide a way for checking rough directions of foreground points to be fitted to background objects in the Fit mode.

The difference of magnification results
An example object
The normal magnification
The magnification
using ForeGround

OverMove

This parameter can be used in all modes. In the Fit mode, foreground points may sometimes be moved to wrong directions too far. This parameter is used to pull back such foreground points. If the value of the parameter is 1.0, and a foreground point is moved 2 times longer than other points belonging to the same polygon, then the foreground point is consider "moved too far" and is pulled back to its original position. By giving the value 1.5 to this parameter, a foreground point is considered "moved too far" if the point is moved 2.5 times longer.

ForceMove

This parameter can be used in all modes. If this parameter is enabled, foreground points that have not been moved because of the lack of collision with background objects are forced to be moved based on the amounts of movement of other foreground points belonging to the same polygon. The destination of a foreground point is undefined if it does not belong to a surface polygon.

The foreground points pulled back by the OverMode parameter are also moved by this parameter.

If the value 1.0 is specified, a foreground point goes the same distance as another point which belongs to the same polygon and goes the shortest distance. The foreground point goes a half distance if the parameter value is 0.5. In the latter case, the farther a point is from another point that can be moved by fitting, the shorter distance the point goes. By contrast, if the value 1.5 is given, the farther a point is from another point that can be moved by fitting, the longer distance the point goes.

The left figure illustrates a combined use of the OverMove and ForceMove parameters. Suppose that the middle red point have been moved too long to the wrong direction. Situations like this may occur in the Fit mode depending on the shapes of foreground polygons. Now, by giving a suitable value to the OverMove parameter, the middle point is considered "moved too far" and is pulled back to the original position. Then, the middle point become an object of the transformation based on the ForceMove parameter. In the Fit mode, the direction of a foreground point that is forced to be moved by this parameter is determined by calculating the average of the directions of neighboring points. As an effect of the ForceMove parameter, the middle red point in the left figure is moved to a suitable position shown as the black dot.
The second figure shown in the left illustrates a case that the value of the ForceMove parameter is 2.0. The leftmost red dot is a foreground point that can be moved by fitting. The next (second) point is moved 2 times longer than the leftmost point. The next (third) point is moved 2 times longer than the second point. In this way, if the value of this parameter is other than 1.0, the farther (nearer) a point is from (to) another point that can be moved, the longer (shorter) distance the point goes. This example describes PointFit's fitting algorithm two-dimensionally, but it actually works three-dimensionally; the distance of a foreground point is calculated by multiplying the average of distances that neighboring foreground points go by the value of the ForceMove parameter.

ForcePlus

This parameter can be used in all modes. This parameter is associated with the ForceMove parameter; the value of this parameter is added to the value of the ForceMove parameter. See the description of the FallOff parameter for more details of the ForcePlus parameter.

FallOff

This parameter can be used in all modes, but makes no sense if the value of the ForcePlus parameter is 0. This parameter is related with the ForceMove and ForcePlus parameters. The value of the ForcePlus parameter is multiplied several times depending on the distance between a point that cannot be moved and another point that can be moved, and the multiplied value is added to the value of the ForceMove parameter. If the value of the FallOff parameter is smaller than 1.0, the value of the ForcePlus parameter gets close to 0 as the point that cannot be moved gets far from the point that can be moved, and thus the value of the ForcePlus parameter gets close to the value of the ForceMove parameter. If the value of the FallOff parameter is greater than 1.0, the value of the ForcePlus parameter gets large. Usually, a value smaller than 0 is not specified to the FallOff parameter.
The left figure shows a case where the values of ForceMove, ForcePlus and FallOff parameters are 1.0, 1.0 and 0.5 respectively.

The leftmost point is one that can be moved by fitting. Since the value of the FallOff parameter to the power of zero equals to 1.0, the amount of movement of the next (second) point equals to the amount of movement of the leftmost point multiplied by 2 (i.e. 1.0 + 1.0 * 0.5^0). Similarly, the amount of movement of the third point equals to the amount of movement of the second point multiplied by 1.5 (i.e. 1.0 + 1.0 * 0.5^1), and the amount of movement of the forth point equals to the amount of movement of the third point multiplied by 1.25 (i.e. 1.0 + 1.0 * 0.5^2).

In this way, the value of the FallOff parameter multiplied by the value of ForcePlus parameter gets close to 0 as a point gets far from a point that can be moved by fitting, and as a result the value of the FallOff parameter gets close to the value of ForceMove parameter.


Tutorials

The Flat mode

This part of tutorials explains the basic features of the PointFit plug-in using a character object.
1. First, we prepare an object that is used as a base of transformation of foreground objects. Here I created an alphabet "P" using the Text tool.
2. The PointFit plug-in subdivides polygons into smaller triangle polygons internally, but in some cases convex objects cannot be properly subdivided. In such a case, you need to subdivide polygons manually. In this example, I cut the joint points of the curved and straight parts of "P", so that the polygons were well subdivided by the Triple tool.
3. Next, we prepare an object to be transformed. Here, I used the Box tool to create a plate object subdivided into 30x20 segments. Select the plane object as a foreground object, and do the character "P" created in Step 2 as a background object. Also, in order to fit them successfully, let the foreground object separate a little bit from the background object.
4. Now we are ready to invoke the PointFit plug-in. Here, I chose the Flat mode, and set the Axis and Direction parameters to "Z" and "+" respectively. These are all default settings. The result, applied MetaNURBS in addition, is shown in the right figure. The points that cannot be fitted to the background object have stayed at their original positions.
5. So, let's apply the ForceMove parameter. Use "Undo" to go back to the state of Step 3, and run the PointFit plug-in again. Here, I gave 1.2 to the ForceMove parameter. The result is shown in the right figure. As you can see, the more distant a point is from the points that can be moved, the longer it goes into the depth (right). The title logo of this page was create in this way.
6. The result we obtained in Step 5 seems good enough, but let's improve more using the ForcePlus and FallOff parameters. Undo, go back to Step 3 again, and rerun the PointFit plug-in. Now, give ForceMove 1.0, ForcePlus 0.3, and FallOff 0.8. The result is shown in the right figure. In this case, a neighboring point A of a point that can be moved goes 1.3 times farther, and a neighboring point B of the point A goes 1.24 times father, and so on. That is, the more distant a point is from the points that can be moved, the more equal amount of movement the point goes, to those of the points that can be moved (i.e. the magnification of the amount of movement closes to 1.0).
The first tutorial ends here. By trial and error together with "Undo", you will be able to find appropriate values of the ForceMove, ForcePlus and FallOff parameters.

The Fit mode

By showing a process of creating clothes with sleeves, this part of tutorials examines possible problems inherent in the Fit mode and illustrates the way to avoid such problems.
1. First, we prepare the body to put on the clothes. Here, I chose a female body with bumpy surface. This never means that I prefer female bodies to ..., yes, I admit it. In the right figure, I used an object with less number of polygons that is not applied "MetaNURBS" -> "Freeze". I also deleted the head part that consists of many polygons and does not affect the fitting process. Since the computation takes long in the Fit mode, make the number of polygons of background objects as small as possible.
2. Next, we prepare objects that become clothes. You can create them in any way you prefer. Here, I created the body part using "Disc", and pulled out the sleeve parts using "Sm Shift". The sleeve parts are cylindrically shaped and polygons are subdivided using "Knife". I also deleted the top and bottom parts of cylinders created by "Disc".
3. Let's apply PointFit. The values of parameters are all default ones except that we select the Fit mode. The right figure shows the result. As you can see, some parts go wrong. Apart from the crotch part, some points in the neck part have not been moved. Since the fitting of simple cylindrical objects using the Fit mode equals to the fitting using the Pipe mode, some foreground points have no corresponding background points, and cannot be moved. Let's improve this.
4. Use "Undo" to go back to Step 2, and select points in the neck part. Then, reshape to some extent using "Size". Also, since the armpit parts seem loose in the figure of Step 3, I subdivided polygons in those parts using "Knife".
5. The right figure shows the result of applying PointFit. The neck and armpit parts were improved. Also, the shape of breasts went fine by subdividing polygons.
6. Next, let's improve the crotch part. Any changes on objects are needed. Go back to Step 2 using "Undo", and apply PointFit after specifying the value 1.0 to the ForceMove parameter. The right figure shows the result.
7. As you can see in the figure in Step 6, there is a thin shadow in the crotch part. This is a phenomenon specific to the Fit mode; in this case, the clothes are too far from the body objects so that loci of points cross to each other, as shown in the right figure. In this figure, black dots represent points moved normally, and blue dots are points moved by the effect of the ForceMove parameter. The loci of the two points in the middle have been cross to each other.
8. This problem can be solved by getting the clothes close to the body objects. You can also avoid this problem using the Magnet parameter, but it is somewhat difficult to manager to get a good result with the Magnet parameter. Although it cannot be seen in the figure in Step 6, the same problem occurs in the waist part. So, I modified the waist part of the clothes using "Size", as shown in the right figure. I reshaped polygons around the waist part to some extent and subdivided some of them again using "Knife".
9. The right figure shows the result. The crotch and waist parts have been improved and the wrinkles appeared around collarbones in Step 5 have been also removed.
10. Although the result shown in Step 9 seems good enough, let's improve the crotch part further using the ForcePlus and FallOff parameters. After several tries, I got the result shown in the right figure by giving ForceMove 1.0, ForcePlus 0.5, and FallOff 0.7. However, there are cases that manual modification is easy and fast.
11. Finally, we get the clothes lifted from the body using the Thickness parameter. The result shown in the right figure was obtained by giving Thickness 1.5cm. Here, there are cases that the clothes sink into convex parts of the body objects. Such a problem can be solved by reverting the original state using "Undo" and subdividing polygons of the clothes corresponding the convex parts of the body using "Knife".
The second tutorial of the Fit mode ends here. As shown in this tutorial, good results are likely to be obtained by getting objects to be moved close to the target objects. You can approach to desired results by trial and error. Good luck!!

Miscellaneous

I disclaim all warranties with regard to this software. Please use it at your own risk. I'm new to LightWave3D and created this plug-in while lacking proper understanding of the internals of LightWave3D. So, I cannot guarantee that the plug-in will work well if it is utilized irregularly.

This plug-in is free software. The copyright of the plug-in and the manual is owned by me (Hiro OTSUKA). I'm very appreciated your comments, feature requests, bug reports, etc. Please send an e-mail to the following address.

Hiro OTSUKA
E-Mail: otsuk@purple.plala.or.jp
URL: http://www1.plala.or.jp/Otsuka/
This manual was originally written in Japanese by Hiro OTSUKA, and translated into English by Tamito KAJIYAMA. Any comments, suggestions and/or corrections regarding to the English version of the manual are very appreciated. Please drop me a line (both English and Japanese are welcome). Thank you for using the PointFit plug-in!