Re: [info-performer] pfDCS help

Date view Thread view Subject view Author view

From: Allan Schaffer (allan++at++sgi.com)
Date: 07/15/2004 14:55:48


Hi Alan,

Alan Gifford wrote:
> I have written a simple program to simulate gravity of a number of
> objects of given mass. Some of the models are much larger than others,
> so I have to scale them to get the scene to be useable. I was thinking
> that since I am setting the scale of the pfDCS to which the model is
> attached, that all my position settings to the pfDCS will be likewise
> scaled. This I do not want, for it would change the distance that
> something is supposed to be moved based on the scale of the model, which
> has nothing to do with the actual physics that I am simulating.
>
> Would it be proper then to create a pfDCS for the position, leave its
> scale at 1.0, and attach to it another pfDCS (to which the model is
> attached) whose scale is changed? I ask because I have done it both
> ways, and I'm having problems with the latter method (unfortunately I
> changed other things which could instead be causing the problem), but
> the previous method of using only one pfDCS seems to work properly,
> despite the fact that the scales are off (in the one test I did) by a
> factor of 1000.

By your description above I'd say, "Yes - that latter method will work."
Of course whatever is causing it trouble will need to be understood. The
general structure would be :

   pfDCS <-- contains the transform
     |
   pfSCS <-- contains the scale value
     |
   pfGeode <-- contains the model / geosets
                 (or a pfGroup if there's more hierarchy underneath)

Now this next bit might be considered cheating, but if each model is in its
own file you could also scale them as a pre-processing step, without any
programming at all. If your model is named "original.pfb", just execute :

  % pfconv original.pfb.X,Y,Z.scale new.pfb

..replacing X,Y,Z with the appropriate scaling values. Then use new.pfb in
your app. That extra extension ".X,Y,Z.scale" is one of Performer's many
pseudoloaders, which are great tricks for manipulating models.

Allan

-- 
Allan Schaffer                                            allan++at++sgi.com
Engr. Dept. Manager, Visual Systems Group                1-650-933-2160
Silicon Graphics                                     http://www.sgi.com


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Jul 15 2004 - 14:55:48 PDT