Hello!

Does anybody know for what reason the first (transforms[0]) TransformGroup
of a MultiTransformGroup will not receive the ALLOW_TRANSFORM_READ, -WRITE,
ALLOW_CHILDRED_WRITE, -EXTEND capabilities?

Or is it just a bug?

The following code is the constructor of MultiTransformGroup:
-----------------------------------------------------
    public MultiTransformGroup(int numTransforms) {
        if (numTransforms < 1)
            numTransforms = 1;

        transforms = new TransformGroup[numTransforms];

        // there is always at least one TransformGroup
        transforms[0] = new TransformGroup();

        for (int i = 1; i < numTransforms; i++) {
            transforms[i] = new TransformGroup();

transforms[i].setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

transforms[i].setCapability(TransformGroup.ALLOW_TRANSFORM_READ);

transforms[i].setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);

transforms[i].setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
            transforms[i-1].addChild(transforms[i]);
        }
    }
-----------------------------------------------------
( the for-loop never hits i=0 and so the capabilities won't be set for
transforms[0] )

When using a SimpleUniverse a application can choose to create a number of
TransformGroups that will be created between the Locale and the ViewPlatform
(using the ViewingPlatform).
But since the SimpleUniverse adds the ViewingPlatform (and with it the
MultiTransformGroup) automatically to the Locale these TransformGroups
became live and the capabilities cannot be set after executing the
constructor. On the other side the TransformGroup cannot be modified using
setTransform because the corresponding capabilities are missing.
So the first TransformGroup becomes kind of "dead" and the application
always has to create one TransformGroup more than needed.


Sincerely yours

 Michael Lorenz.
 ([EMAIL PROTECTED])





=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to