Advanced WF3D Functions

Extend the interaction with the scene.

Explore advanced viewer functions and their interfaces. Use exact signatures and examples when integrating them.

WinFrame 3D - Advanced Functions


  • AutoPan - Controls camera auto-spin. When "on", camera points toward origin and spins its position around the origin at whatever radius it is at. Same as typing s, for auto-spin, while viewing. But this command can be embedded within WFL scripts. The autopan command lets you turn the camera-spin on or off, for a given time-range, and set the direction of spin.
    Example:

```

```

The autopan_rel version interprets the time amounts as relative to the current time. - Camera Follow - Causes the camera to follow the named object, beginning at the specified time. The camera will point at the object, and its position will be offset from the object by the distance in the specified offset amounts for each axis.

Example:

```

```

The camera_follow__rel version interprets the time amount as relative to the current time. - Sleep Until - Causes the WFL reader to pause until the specified time. Rendering continues.

Example:

<sleep_until T="xx" /> - Set Origin - Sets the effective origin coordinate, used when pointing camera to the origin, by pressing the "o" key during viewing.

Example:

<set_origin X="x" Y="y" Z="z" /> - Set Light OnOff - Turns the named light on or off. There are eight available lights, numbered 0 through 7, which control the scene lighting. Equivalent to:   WF3D_Set_Light_OnOff( int light_num, int on_off ).

Example:

<set_light_onoff light="x" state="on/off" /> - Set Light Dir - Set the named light's pointing direction. There are eight available lights, numbered 0 through 7. Equivalent to:   WF3D_Set_Light_Position( int light_num, float x, float y, float z ).

Example:

<set_light_dir light="x" x="x" y="y" z="z" /> - Set Light Position - Set the named light's location. There are eight available lights, numbered 0 through 7. Equivalent to calling interface:   WF3D_Set_Light_Direction( int light_num, float x, float y, float z ).

Example:

<set_light_pos light="x" x="x" y="y" z="z" /> - Set Light Color - Set the named light's color. There are eight available lights, numbered 0 through 7. Equivalent to calling interface:   WF3D_Set_Light_Color( int light_num, float r, float g, float b ).

Example:

<set_light_col light="x" r="r" g="g" b="b" /> - Trajectory Path - Mark a trail behind the path of a moving object. The more distant elements of the trail can fade-away after a time. Name the object (obj) to be traced, and the time (t1, t2) that the trace should be visible. Be sure that t1 is after the object is realized. The path will be drawn as straight line segments. The attribute dt sets the time between segment end-points. The attribute fade_t sets the fade-time, which is the time delay after which a given segment is removed. An alternate optional method to remove the oldest segments is by the number of active segments, max_n. You can leave all segments permanently in view by setting their attributes to very large values (ex. 9e9). The style attribute is optional, and controls how the path is drawn. Present styles available are: 0, which provides a simple line; and 1, which provides a line with vertical markers going from each vertex to ground. The latter is helpful to show over what points on the land an airborne object traversed. The default style is 0. The r, g, b, and trans attributes specifiy the color and transparency of the path-lines, respectively. The r, g, b values span from 0.0 to 1.0, for red, blue, green brightness, and a transparancy of 1.0 is opaque, 0.5 is semi-transparent, and 0.0 is invisible. The optional yoffset attribute enables a vertical offset of the path-line from the object's actual position. It is useful when an object's vertical origin (0.0) is not defined at its center, or whenever a different trajectory intersection point is needed.

Example: (w/example nominal values)

```

```

(This feature is available in version 3.90 and beyond.) - Time_Display - Causes WF3D to display the current time.

Example:

<time_display name="" r="", g="", b="", scale="" thickness="" x="" y="" z="" xang="" yang="" zang="" dt="" tscale="" kind="" />

It is usually most useful to display the progression of time on a fixed position of the screen. So use the foreground mode as in:

``` <time_display r="1", g="1", b="0", scale="0.3" thickness="2" x="42" y="-92" z="0" dt="0.2" kind="7" />

```

The dt attribute controls how often the display is updated. Default equals "1", which is once per second. To update by tenths of a second, set to "0.1".

The tscale attribute controls whether to dilate or compress the displayed time value. Default equals "1". For example, if you wish to display in milliseconds, you could set the tscale to be "1000".

The kind attribute controls the type of time display. Default equals "0", which displays the integer value of time, which would usually be whole seconds. The following other options are available:

    • Default. Displays time value as an integer. 1. - Displays time value in Hours:Minutes:Seconds format. 2. - Displays time value as an integer preceded by "T =". 3. - (reserved) 4. - Displays time value in Days:Hours:Minutes format. 5. - Displays time value in decimal format preceded by "T=". 6. - Displays time value in decimal format limited to only two decimal places. 7. - Displays time value in decimal format limited to only one decimal place.

Example: 139
Example: 0:2:32
Example: T = 139

Example: 0:0:2
Example: T = 139.5821
Example: T = 139.58
Example: T = 139.6 - Show_Axes - Causes WF3D to display the X, Y, Z axes. Helpful for locating the (0,0,0) origin.

Example:

```

``` - Exit After Time - Causes WF3D to exit at the specified time.

Example:

```

```

This page is an editorial rewrite of source documentation. Historical status, availability, and platform notes are not independently verified for a current release. Technical examples are reference material, not a live simulator.