DMesh Documentation - Muscles
The manner in which muscle are created by the combination of the various muscle curves can be somewhat confusing at first. The various curves used to describe a muscle are not 3 Dimensional objects in themselves. Although they become a 3D surface when taken all togeather, individual curves are really only 2D (and in some cases 1D) objects.
The center curve has no 3D aspects by itself, and is better thought of as a 'line' drawn on the surface of the underlying object. The width curve further describes how 'wide' this line is at any point along it's length. This is similiar in concept to using a line drawing tool in a paint program. You use the mouse to mark the end points of the line, (and any additional points for a multi-segment line, ) and a line is drawn connecting all the dots and using the current pen width.
The control points for the center curve can then be thought of as being equivalent to the dots used in the connect-the-dots line drawing routine. The width curve is similiarly related to the pen width, except that rather than specifying the pen width as X many pixels wide, we use a curve instead. This gives us a pen width that is variable throughout the length of the line. These two parts don't completely define/draw the line, they just describe 'where' the line will be!
Just as the paint program will have to be told what colour(s) and gradient variations to use in drawing the line, the muscle definition will similiarly need to know the x-section and height variations. As an example, consider drawing a line with a color gradient that ranged from dark blue at the start ot the line, and increased to light blue at the end. The single colour 'blue' could then be likened to the x-section curve, as they both describe the basic characteristic of what will be 'added'. The gradient from dark to light would be likened to the height curve, in that both describe 'how much' of this characteristic to apply to the line as we proceed from beginning to end.
In many cases, we will be drawing lines using brushes, rather than a single colour pen, and the x-section curve is actually much closer in concept to using a coloured brush. Whereas each pixel in the brush would specify a single colour, the x-section will define the amount of 'bulge' or surface displacement. Note though, that both are oriented 'perpendicular' to the direction of the line. Also, just as the brush will be squished and stretched to fit the actual line/pen pixel width, so the x-section curve will be scaled to fit the actual width of the muscle at that point along the line. (Typically, the x-section is an inverted U shape, so the outside edges of a wide line/muscle have little or no displacement, while the middle of the line has the most. ) The gradient or height components are further used to modulate or scale this colour or displacement, and follow 'with' the direction of the line.
So in summary:
The center and width curves describe the 'position' of the muscle, but by themselves have no real impact on, or make any changes to, the surface. Just as the end points of a line and a pen width will describe 'where' a line will be drawn and how many pixels it will cover, they don't describe 'what' will be drawn. Similiarly, neither the x-section or height curves are dependent on 'where' you draw the line, or how 'wide' you make it. The line can be long and skinny, or short and fat, and the height and x-section curves will be scaled to fit within this area. The indivdual curves are each only 2D, and it is the combination of the four that provides a 3D result.
Of the four, only the center curve has any real 'physical' coordinates, while the rest are all defined relative to the other parts. The width curve describes how wide the line is, but not where. The x-section curve will be scaled to fit within the specified width, and the height curve will be scaled to fit within the length defined by the center curve.
Individual muscles are created by defining its connection (or clip) points, a set of curves describing its position, and another set of curves defining its displacement shape.
Connection points describe the starting and ending points of the muscle. For example, a muscle that travels the entire length of the underlying object would have its clip points defined as 0.00 and 1.00 respectvely. A muscle that started half way through the limb and continued to the end would have clip points of 0.50 and 1.00. A muscle such as a knee cap or elbow, would start slightly below the half way mark of the limb, (say 0.45,) and end slightly above half way, (roughly 0.55.) Changing these clip points is an easy way to shrink, stretch or shift the muscle, without changing its overal shape. The exact meaning of the clip points varies depending on the type of muscle:
For verticle muscles, the clip points refer to the low and high values for the v component. The muscle will have no effect for any values of v that are below or above these values.
For horizontal muscles, these points refer to the u component.
For point muscles, the low and high values refer to the u and v scaling components for the muscles area of influence. If values of 1.00 and 1.00 are used, the muscle will be circular, while other non-equal values will create elliptic muscles.
Position curves describe the amount of surface area influenced by the muscle. The center curve describes the center line of the muscle, while the width curves describe how wide the muscle is at any specific position. (Currently, muscle widths are symetrical about the center position, with a single curve describing the total width. The low and high widths are calculated as one half this amount. This is being revised to allow for non-symetrical muscle width definitions.)
Shape curves describe the actual displacement of the surface within the muscle bounds. The height curve describes how far the muscle 'bulges' from the surface throughout its length, while the x-section curve defines the actual shape of this bulge.
Texture ID defines the ID of the texture to be used for this muscle. If a 0 (zero) is entered, then the default texture for the layer will be used. If the default texture for the layer is zero, then the default for the object will be used.
Scale allows for the height of the muscle to be changed without having to modify the individual components of the height or x-section curves. Generally, a value of 1.00 is used to provide 100% scaling. Should the muscle become too prominent in relation to the other muscles, (or not prominent enough,) the actual displacement of the muscle can be increased or decreased by changing this value.
Active determines whether this muscle is to be calculated or not. If active is on, the muscle will be calculated. Specific muscles can therefore be individually activated and deactivated as appropriate.
Clip Position describes the lowest and highest uv-grid values that will be associated with this muscles. For verticle muscles, it refers to the lowest and highest values of v, while for orbital muscles it refers to u. Any grid values outside of this range will be unaffected by the muscle. Increasing or decreasing these values is a simple method of stretching or shrinking an existing muscle without having to change any of it's curve definitions. Currently, values outside of the range of 0.00 to 1.00 are undefined, and will produce unpredictable results.
Resolution determines the number of polygons to be used when creating this muscle as a separate object. If viewing or exporting using the layered option, each muscle will be generated as a separate mesh grid composed of U*V polygons. This is mostly used when creating clothes or hair, but can also be useful for creating 'thin' overlay meshes that contain much higher resolution than the underlying object. Eyelids and nostrils are two significant examples of objects that are better exported as separate meshes rather than as part of the base 'skinned' object mesh.
Mirroring Specific muscle defintions can be mirrored in the u or v direction. For example, a single rib could be created on the right side of the object, then copied and pasted as a new muscle. This new muscle could then be mirrored in the u direction to have it appear on the left side. This mirroring function does not constitue a link to the original muscle, but only reverses the respective u or v position. The new curve can be individually customized to provide slight variations between the two copies.
Offsets This allows specific muscle defintions to be shifted in the u or v direction, without changing the basic muscle curve defintions. If a muscle is slightly low, high, or too far left or right, an offset value can be entered to slightly modify the muscles position. Similiar to the mirroring example above, the rib could also be copied/pasted and offset vertically to create a higher second, third and/or more ribs.
Type determines the orientation of the muscle. Verticle muscles are oriented with their length running from low to high in the v direction of the object, while orbital muscles are oriented with their length running in the u direction. Point muscles provide for a circular muscle such as a nipple or belly button. Compound muscles are defined in absolute uv coordinates, with their length running tangent to the curve direction. These Compound muscles are computationally intensive, and should be avoided if possible, (and since they are currently disabled, this chouldn't be too difficult.) . The following sections provide additional muscle-specific details for each type.
Center curve defines the center position of the muscle. The exact meaning varies slightly depending on the muscle type, but in general it defines the position in either the u or v direction for various points along its length. This curve will be scaled to fit within the clip positions described above.Values outside the range 0.00 to 1.00 are undefined and will produce unpredictable results.
Width Curve defines how wide the muscle will be at various positions along its length. This curve is defined relative to the center curve. Moving a muscle will not affect its width. If the muscle is stretched on shrunk, the width curve will be scaled to fit within the new dimensions. Values less than 0.00 are undefined and will produce unpredictable results. Values greater than 1.00 are also undefined but may sometimes produce useful results, (although potentially changing with subsequent verions.)
Height Curve describes the height scaling factor to be applied to the muscle displacement. Generally, muscles are 'bulgiest' in the middle part of their length, while the end points have a fairly minimal displacement. Muscles such as an abdominal will have a much more complicated height definition. Values less than 0.00 will be treated as 0.00, while there is no limitation on maximum values. The height curve exactly parallel's the center curve.
X-section Curve describes the cross-sectional shape or bulginess, and is oriented perpendicular to the length of the curve. Generally, the starting and ending values are 0.00, with the internal values specifying the shape of the cross-section. This curve is typically an inverted, (although sometimes flatted,) U when used to define muscles. For objects such as hair and clothes, these guidlines are not as relevant. Values less than 0.00 will be treated as 0.00, while there is no limitation on maximum values.
Clip Position describes the lowest and highest values of v that will be associated with this muscles. Any portions of the object's v coordinates that are outside this range will be unaffected by the muscle. Changing clip positions will modify the total length of the muscle, but will not otherwise modify its shape or height.
Center curve defines the center position of the muscle in the u direction. The center curve will be scaled to fit within the clip positions.
Width, Height and X-section Curves see the general discussion above.
Oribital muscles are defined in eactly the same manner as verticle muscles, with the exception that the references to u and v are replaced respectively with v and u. In fact, a muscle can be rotated 90 degrees simply by changing its type from one to the other.
Clip Position instead defines the uv scaling factor, so be sure that neither is set to zero. Setting to 1 (one) and 1 (one) will make a spherical bulge, while using none-equal values will create elliptical ones. The specified scaling values will NOT be modified to compensate for the basic shape of the mesh. Values of one and one will produce spherical bulges for planar objects, but not neccesarily so for conics or spherics.
Center curve defines the center of the muscle. Only the first control point is needed, and the two values refer to the absolute uv position of the muscle center, so an entry such as <0.5,0.50> will place it exactly in the middle, while <0.5,0.25> will place it in the lower middle.
Width Curve defines how far out from the middle the muscle will radiate. For point muscles, the starting point is at the bottom, and rotates clockwise around the point, with the end being back at the bottom again.
Height Curve describes how high the muscle is using the same method as the width. Generally only a single height value is given, so that the muscle has the same height throughout its circumference. The beggining and ending values should be equal to avoid the jaggies where they meet.
A typical entry would be simply <0,1>, giving it an equal height thoughout. Another example would be <0,1>,<0.5,0>,<1,1>, which would make the muscle full height at the bottom, reducing to zero height at the top, and back to full at the bottom again.
X-section Curve describes the muscle cross-section from the center of the muscle to its outer edge. The zero point of the curve is at the center point of the muscle. This curve is then rotated around the center point in a clockwise direction, and stretched out to fit the associated width.
(under construction - awaiting final implementation details)