>MIME-Version: 1.0
>Content-MD5: TlNpW4obGo47WQAPQQbfOw==
>Date: Tue, 24 Apr 2001 18:18:22 -0700
>From: Mona Wong <[EMAIL PROTECTED]>
>Subject: [JAVA3D] new canvas procedure?
>To: [EMAIL PROTECTED]
>
>Hi:
>
>        What are the steps that I need to follow when my java 3d program is
done
>with one canvas scene and needs to setup another?  Basically, when the user
>wants the program to load a new file, the program needs to get rid of the
>current canvas/scenegraph and create a new one from the new file.  If there is
>doc somewhere about this, I would appreciate a pointer.
>


See VirtualUniverse

    /**
     * Removes all Locales and their associates branch graphs from
     * this universe.  All branch graphs within each Locale are
     * detached, regardless of whether their ALLOW_DETACH capability
     * bits are set.  Each Locale is then marked as being dead: no
     * branch graphs may subsequently be attached.  This method
     * should be called by applications and applets to allow
     * Java 3D to cleanup its resources.
     *
     * @since Java 3D 1.2
     */
    public void removeAllLocales()

You can use,

  universe.getViewer().getView().removeCanvas3D(canvas3d)
  universe.getViewer().setViewingPlatform(null);
  universe.removeAllLocales();

to cleanup resource when canvas remove.  Also make
sure Java3D v1.2.1 or v1.2.1_01 is used. There are bugs
in v1.2 which cause memory leak)

- Kelvin
--------
Java 3D Team
Sun Microsystems Inc.

===========================================================================
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