Michael Jones (mtj++at++babar)
Thu, 26 May 1994 10:16:21 -0700
You'll want to get a the manuals. They come with 1.2 and we worked
too hard writing them for you not te be enjoying their information.
That notwithstanding, what you want are pfBillboard nodes. They
provide an automatic rotation of geometry (that is in the XZ plane
and which points in the +Y direction) to follow the eyepoint.
Here's the man-page you lack:
pfBillboard(3pf) IRIS Performer 1.2 libpf Reference Pages pfBillboard(3pf)
NAME
pfNewBboard, pfBboardPos, pfGetBboardPos, pfBboardMode, pfGetBboardMode,
pfBboardAxis, pfGetBboardAxis - Create and update automatic rotation
billboard nodes.
C SPECIFICATION
#include <Performer/pf.h>
pfBillboard * pfNewBboard(void);
void pfBboardPos(pfBillboard* bill, long i, pfVec3 pos);
void pfGetBboardPos(pfBillboard* bill, long i, pfVec3 pos);
void pfBboardMode(pfBillboard* bill, long mode, long val);
long pfGetBboardMode(pfBillboard* bill, long mode);
void pfBboardAxis(pfBillboard* bill, pfVec3 axis);
void pfGetBboardAxis(pfBillboard* bill, pfVec3 axis);
DESCRIPTION
A pfBillboard is a pfGeode in which each pfGeoSet rotates to follow the
eyepoint. Billboards are useful for complex objects which are roughly
symmetrical about one or more axes. The billboard tracks the viewer by
rotating about an axis or a point to present the same image to the viewer
using far fewer polygons than a solid model. A classic example is a a
textured billboard of a single quadrilateral representing a tree.
A pfBillboard can contain any number of pfGeoSets. pfGeoSets are added
to and removed from the pfBillboard using the pfAddGSet and pfRemoveGSet
routines for pfGeodes. Each pfGeoSet rotates independently to follow the
viewer. By convention, the pfGeoSet is rotated about the +Z axis so that
the +Y axis points towards the eye point.
pfNewBboard creates and returns a handle to a new pfBillboard.
pfBboardPos specifies the position pos for the pfGeoSet with index i.
pfGetBboardPos copies the position of the pfGeoSet with index i into pos.
Billboards can either rotate about an axis or a point. Axial billboards
rotate about the axis specified by pfBboardAxis(). The rotation is about
the origin (0,0,0) of the pfGeoSet. In all cases, the geometry is
modeled in the XZ plane, with +Y forward. When rendered, the billboard
is rotated so that the -Y axis points back to the eye point. The +Z axis
is the pfGeoSet's axis of rotation.
An axial rotate billboard is specified by setting the PFBB_ROT mode of
the billboard to the value PFBB_AXIAL_ROT using pfBboardMode. The axis
of rotation (x, y, z) is specified using pfBboardAxis.
Page 1
pfBillboard(3pf) IRIS Performer 1.2 libpf Reference Pages pfBillboard(3pf)
pfGetBboardAxis returns the axis of the pfBillboard.
Point rotate billboards are useful for spherical objects or special
effects such a smoke. They come in two varieties depending on how the
the remaining rotational degree of freedom is determined (rotating the -Y
axis towards the eye, still leaves an arbitrary rotation about the
pfGeoSet's Y axis). If the PFBB_ROT mode on the billboard is set to
PFBB_POINT_ROT_EYE, the billboard is rotated so that the +Z axis of the
pfGeoSet stays upright on the screen. If the PFBB_ROT mode on the
billboard is set to PFBB_POINT_ROT_WORLD, the billboard is rotated so
that the angle between the +Z axis of the pfGeoSet and axis specified
with pfBboardAxis is minimized.
Both PFBB_AXIAL_ROT and PFBB_POINT_ROT_WORLD billboards may "spin" about
the Y axis of the pfGeoSet when viewed along the rotation or alignment
axis.
After the first pfSync, the number of pfGeoSets, the number and length of
the primitives, and planarity of the vertices should not be changed.
Some database formats may place a transformation above each billboard for
positioning it. As with a pfGeode containing a small amount of geometry,
having many billboards with transformation matrices above them can be
expensive.
Since billboards always rotate towards the eyepoint, billboards in
adjacent channels with the same eyepoint have the same orientation.
Channels with different eyepoints will have different billboard
orientations.
When database sorting is enabled (PFCULL_SORT is set by pfChanTravMode)
and a pfBillboard node has no pre or post draw callback (see
pfNodeTravFuncs), then it will be drawn after opaque geometry to improve
pixel fill rate and to reduce artifacts resulting from blended
transparency (see pfTransparency).
BUGS
Intersection traversals do not support intersection with billboards.
pfFlatten only transforms the position of a billboard, not the axis.
Normals are not transformed.
Only axes of +X, +Y and +Z are supported
SEE ALSO
pfChanTravMode, pfFindBboard, pfFlatten, pfNode, pfNodeTravFuncs,
pfScene, pfTransparency
Page 2
--Be seeing you, Phone:415.390.1455 Fax:415.390.2658 M/S:9U-590 Michael T. Jones Silicon Graphics, Advanced Graphics Division mtj++at++sgi.com 2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:18 PDT