DVscale


Synopsis

scale a 3D mesh in X, Y, and/or Z


group DVscale {
Mesh+IPort2 &in ;
float+Iparam scale_x = 1.0;
float+Iparam scale_y = 1.0;
float+Iparam scale_z = 1.0;
DefaultXform+nonotify scale_xform {
mat => {{scale_x, 0.0, 0.0, 0.0},
{0.0, scale_y, 0.0, 0.0},
{0.0, 0.0, scale_z, 0.0},
{0.0, 0.0, 0.0, 1.0}};
};
group out_xfm {
DefaultXform xform;
};
DVconcat_xform concat_xform {
xform_in1 => in.xform;
xform_in2 => scale_xform;
&xform_out => out_xfm.xform;
};
Mesh+OPort2 &out => merge( out_xfm, in);
};

Description

DVscale scales a mesh in X, Y, and/or Z, making it appear larger or smaller in the renderer window. It accomplishes this by modifying the field's associated transformation matrix, xform.

Input

&in

The input is a reference to a field containing any 3D mesh.

scale_x
scale_y
scale_z

Floats. These inputs independently control the degree of scaling in X, Y, and Z. The default 1.0 means "render at `actual' size."

Output

&out

The output is a reference to a new object that is the merge of the new xform, plus a reference to the original field.

Files

v/dv.v

Utility DVM macros

DVMscale_param

Example

Libraries.Main.Filters.scale

See also