From: Allan Schaffer (allan++at++sgi.com)
Date: 01/02/2004 15:52:53
Lawrence E Bertoldi wrote:
> 1 Use a bounding box to find the size
> 2 Calculate the scale factor to get to the size you want
> 3 Use a pfMatrix and a pfSCS to scale the object.
> 4 Add the scs to the scenegraph
>
> Here is the code for step 3. I'll leave the rest to you!
>
> pfGroup *model = (pfGroup *)pfdLoadFile(filename);
> pfMatrix mat;
> mat.makeScale(scale_length, scale_height, scale_width);
> pfSCS *scs = new pfSCS(mat);
> scs->addChild(model);
>
> "Mr. Rajesh R" wrote:
>>My pfb model is too small enough to view from a given eye location.Can I
>>scale the model using openGL performer functionalities.
Also there is a code-free method for doing this, using the .scale
pseudoloader. Just append ".x,y,z.scale" to the filename as you load the PFB.
e.g.: perfly esprit.pfb.1.0,1.0,2.5.scale
..will scale the esprit.pfb by 2.5 in Z.
Pseudoloaders are super cool. They let you do all sorts of interesting
things to data at load-time (or even at run-time). We ship psuedoloaders for:
- rot
- trans
- scale
- breakup (spatializes the scene graph into an octree)
- subdiv (makes subdivision surfaces)
- geoa (converts geosets to geoarrays)
- doublerot
- doubletrans
- doublescale
- lodfix (fixes scaled LODs)
- ctol (retess parametric surfaces w/ given chordal dev. tolerance)
- ttol (sets parametric surfaces' topology tolerance)
- etc
Check out those directories under /usr/share/Performer/src/lib/libpfdb/ or
%PFROOT%/lib/libpfdb/
Allan
-- Allan Schaffer allan++at++sgi.com Engr. Manager, Core Rendering 1-650-933-2160 Silicon Graphics http://www.sgi.com
This archive was generated by hypermail 2b29 : Fri Jan 02 2004 - 15:52:36 PST