hi,
I got a problem with the ModelTransform using the pure immediate mode:

I need to render a tree structure with every node containing a Transform3D
(scene graph similar) so I tried like this:

    public void render(GraphicsContext3D gc) {
        // save the current ModelTransform
        Transform3D oldT3d = new Transform3D();
        gc.getModelTransform(oldT3d);

        // get the local Transform
        Transform3D modelT3d = new Transform3D();
        this.getTransform(modelT3d);

        gc.multiplyModelTransform(modelT3d);

        for(int i=0; i< children.length; i++ )
            children[i].render(gc);

       gc.setModelTransform(oldT3d);
    }

but the modelTransform before and after the method isn't the same !
so I tried this:


    public void render(GraphicsContext3D gc) {
        // get the local Transform
        Transform3D modelT3d = new Transform3D();
        this.getTransform(modelT3d);

        gc.multiplyModelTransform(modelT3d);

        for(int i=0; i< children.length; i++ )
            children[i].render(gc);

        modelT3d.invert();
        gc.multiplyModelTransform(modelT3d);
    }

which works fine, but now I want to implement a ModelTransform Stack so 2nd
version isn't sufficient :o(


any ideas what I could have done wrong ?

thx for answers

- Michael Nischt

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to