VisionX V4VRENDERVisionX V4
NAME

vrender − generate an image from polygons

SYNOPSIS

vrender if=pfile of=ofile [-a] [-e] [-i] [-r] [-s] [-b] [-f] [-g [in=sc[,os]] [ls=x,y,z] [-c [-C]]] [xy=<size>[<ysize>] [-l]] [-w] [-x] [-n] [-m] [t=<string>]

DESCRIPTION

Vrender generates a range or an intensity image from a set of 3-dimensional convex polygons. In a range image each pixel has a value related to the depth (in the z dimension) of the visible surface. The default is to render a real valued range image; however a variety of grey level rendering options are available. The input is expected to be in the VisX graph file format.

Surface color information may be provided by RGB color attributes or by color index values. When RGB values are provided in the input file a image may be rendered with either a single light source or with uniform illumination. When colors are provided by index values only the uniform illumination model can be used. If a color index rendering option is specified and no color index information is available in the input file, the background is set to 0, polygon faces are set to 128 and polygon edges are set to 255.

The old VisX "pla" format is no longer directly supported. A pla file can be converted into the VisX graph format (vg) with the vtograph command. For standard pla files the correct command is:

vtograph if=file.pla bb=0,10,0,10,0,10 of=file.vg

OPTIONS

if=pfile

The polygon input file in VisX graph format

of=ofile

The output "ofile" is a VisX image. The output image is real valued (VisX format 3) unless a z scale option is selected (-r or -s) or a gray scale option is specified (-g, -c, -n, -m, -w or -x) in which case it is in byte format (format 1).

xy=size

The output image size defaults to the size of the bounding box (10 x 10, for pla files) ;however, this may be set to be a different value, size, by specifying the xy= parameter. The rendered image will be scaled to fit into the available space specified by the size parameters.

-a

The -a option autoscales the image size to 90% of the image space in x and y ( the z values are not affected).

-e

The -e option inhibits the scaling of the data when an image size is specified with the xy= parameter.

t=<text string>

The t= option will annotate a byte image with a text string that is centered at the top of the image.

OPTIONS (RANGE IMAGES)

-i

The -i option inverts the z range such that greater z is closer.

-r

By default the z dimension has the same scale as the x and y dimensions. The -r option scales the z range from 60 to 240.

-s

The -s option scales the z range from 0 to 255.

-b

The -b option forces vrender to do integer computations and to produce a byte output image.

-f

The -f option forces range to do float computations and to produce a float output range image even when z scaling is specified.

OPTIONS (INTENSITY IMAGES)

-g

The -g (grey) option specifies that an intensity image rather than a range image will be generated. This option is useful to view the object in a more conventional manner. A single light source is used to illuminate the object and light intensities are computed according to a lambertian model. When the -g option is specified a number of restrictions apply: the -e option is automatically selected, the output is an unsigned byte image (the -f option has no effect) and the -a and the -e options are not available.

-c

the -c option specifies that a full color image is to be generated. This is only effective when the input image is a VisX graph file with RGB color information. The -g option restrictions also apply to -c.

-C

The -C option is similar to the -c option except that it clamps the shading so that colors are rendered at their original intensities (independent of any light sources).

ls=x,y,z

The ls option allows the location of the light source to be specified when the -g, -c, or -C option is specified. By default, the location of the light source is at [0, 0, 20] which corresponds to the center of the viewing screen and 20 units from along the z direction in the coordinates of the input polygon file. (The light source coordinates are displaced from the polygon coordinates by [maxx/2, maxy/2, 0] so that [0, 0, <value>] corresponds to the center of the viewing screen in x and y).

in=scale[,os]

The in= option allows the intensity of the light source to be specified when the -g, -c, or -C option is specified. By default the the light intensity is 1.0 which gives an intensity range of 0 to 255. the first argument to in= specifies a value for the intensity scale. If a scale factor greater than 1 is specified then an overflow in the pixel value range may occur. The second optional parameter to in= specifies an offset that is added to the pixel value before scaling. For example, the -r option, when specified, results an offset of 60 and a scale of 0.706 (180/255).

-l

The -l option specifies different default settings for the light source so that a more pleasing rendering is given in many cases. these settings are equivalent to in=0.5,128 and ls=maxx,maxy,6*maxz. ls= and in= parameters may be specified to override these new defaults.

OPTIONS (INTENSITY IMAGES WITH COLOR INDICES)

-x

The -x option specifies that the polygons are represented by the color index values (see also -m).

-w

The -w option specifies that the a wire frame representation of the polygons is to be rendered. The lines are given color index values; there is no hidden line removal.

-n

The -n option specifies that the a wire frame representation of the polygons is to be rendered with hidden line removal. The lines are given color index values; some border lines are sometimes not completely rendered due to roundoff errors. The q= parameter may be used to reduce this effect. Try using a value for q of slightly less than one.

-m

The -m option specifies that the polygons are represented by the color index values after a wire frame render option (like -w followed by -x). This may offer a superior rendering to the -x option especially when there are line vectors to be rendered in addition to closed polygons.

-p

The -p option specifies that the polygons and their boundaries are represented by the color index values (like -x followed by -n). This is used to show both the visible polygon faces and boundaries. The boundaries is affected by the q= parameter (see the -n option).

q=<value>

Set a fudge value for the -n and -p options. This moves the face information slightly behind the boundary information to ensure that the boundary is rendered. A value of about 0.97 is recommended, smaller and hidden parts of the boundary may be seen larger and parts of the visible boundary may not be represented. The default value is 0.98

AUTHORS

C. Zoulas, A.P.Reeves

BUGS

The coordinate system used by most VisX programs is compatible with range having the -i (inverse) option specified. This polygon coordinate system for an n x m image is as follows: positive z direction away from the viewer, positive x along the image rows from 0 to n, and positive y direction along the image columns from 0 to m. For a display device with (0,0,z) in the upper left corner, this will result in a left-handed coordinate system. This is a little confusing, as a range image (created with the -i option) will effectively show increasing values as the object extends towards the viewer, and, consequently, further in the negative z direction.

SEE ALSO

vtograph(1),vgtran(1)