DVmesh_uv


Synopsis

generate texture (u,v) coordinates from the (x,y) coordinates of a mesh's nodes


module DVmesh_uv {
Mesh+IPort2 ∈
int+IPort2 uv_switch = 0;
int+IPort2 u_flip = 0;
int+IPort2 v_flip = 0;
float+IPort2 u_shift = 0;
float+IPort2 v_shift = 0;
float+IPort2 u_scale = 1;
float+IPort2 v_scale = 1;
.
. (internal subobjects omitted for brevity)

.
Node_Data uv_data {
nnodes => <-.in.nnodes;
nnode_data = 1;
node_data {
veclen = 2;
id = 670;
values => combine_array(switch_uv.out.values,switch_vu.out.values);
};
};

Mesh+Node_Data+OPort2 &out => merge(uv_data, in);
};

Description

DVmesh_uv takes an input field and generates texture coordinates based on the physical (X,Y) coordinates of the mesh. The input Z coordinate is ignored. The resulting texture data is merged into the field and output. The output field can then accept a texture map.

Controls are provided to position the texture on the mesh by shifting and scaling the mapping from physical to texture space.

Input Ports

in

Field. The mesh to be textured.

uv_switch

int. Switch U and V (or X and Y) when generating the texture coordinates.

u_flip

int. Flip U so that the texture is applied backwards in X.

v_flip

int. Flip V so that the texture is applied backwards in Y.

u_scale

float. Scale U by this amount. The larger this value, the less space in X the texture takes up. In other words, decreasing this value stretches the texture, increasing it compresses the texture.

v_scale

float. Scale V by this amount. The larger this value, the less space in Y the texture takes up. In other words, decreasing this value stretches the texture, increasing it compresses the texture.

u_shift

float. Shift U by this amount. Positive shift shifts the texture to the left, negative shifts to the right.

v_shift

float. Shift V by this amount. Positive shift shifts the texture down, negative shifts up.

Output Ports

out

Mesh+Node_Data. Contains the input mesh and data, as well as the generated texture coordinates.

Path

Libraries.Visualization.Primitives

File

v/dv.v

See also