That's too slow. With large number of shapes, you'll actually see each
one disappear or appear, one at a time ... unless that is what you want, I
suggest using the Switch class. I did exactly this because I had a lot of
shapes to turn on and off.
Cheers,
Mona
> Why not just play with the visibility flag ? You can turn objects on/off by
> just setting this flag!
>
> Florin
>
> -----Urspr�ngliche Nachricht-----
> Von: Josh Richmond [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 12. August 2002 15:29
> An: [EMAIL PROTECTED]
> Betreff: Re: [JAVA3D] Transparency or detaching - make objects disappear
>
>
> Hi Ai,
>
> I know I'm not answering your question about transparency, but I think using
> a Switch node may be a preferable solution.
>
> Josh
>
> >>> [EMAIL PROTECTED] 08/12/02 07:06AM >>>
> Dear all;
>
> My scene contains about 1000 objects. I want to make about 750 of them
> disappear and appear in my scene by clicking some buttons. Which one is
> a better approach in terms of cheaper rendering?
>
> 1) Making the appearance of the objects totally transparent and than
> opaque?
> 2) Detaching the objects from the scene and than attaching them again?
>
> I chose the first approach:
>
> Before I use transparency attributes (Code_1) the objects are looking
> fine (see "without_tranparency.jpg"). Than I converted my code so that
> the objects have transparency attributes (with 0.0 or 1.0 - opaque and
> totaly transparent). When I apply transparency value 0.0 I expect my
> objects to be totally opaque. However, the objects have some
> transparency even if the value is 0.0 (see "with_tranparency.jpg"). Has
> anybody got idea why this happens?
>
> Regards
> Ali
>
>
> // APPEARANCE CODE_1_WITHOUT TRANSPARENCY ATTRIBUTES
> Appearance app = new Appearance();
>
> ColoringAttributes ca = new ColoringAttributes();
> ca.setColor(0.921875f, 0.92578125f, 0.81640625f);
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
> app.setColoringAttributes(ca);
>
> shape.setAppearance(app);
>
> //**************************************************************************
> ****************
>
> // APPEARANCE CODE_2_WITH TRANSPARENCY ATTRIBUTES
> Appearance app = new Appearance();
>
> ColoringAttributes ca = new ColoringAttributes();
> ca.setColor(0.921875f, 0.92578125f, 0.81640625f);
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
> app.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ);
> app.setColoringAttributes(ca);
>
> TransparencyAttributes ta = new TransparencyAttributes( );
> ta.setTransparency(0.0f);
> ta.setTransparencyMode(TransparencyAttributes.BLENDED);
> app.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
> app.setCapability(TransparencyAttributes.ALLOW_VALUE_READ);
> app.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_WRITE);
> app.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ);
>
> app.setTransparencyAttributes(ta);
> shape.setAppearance(app);
>
> ==========================================================================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".
>
> 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".
==================================================================
Mona Wong-Barnum
National Center for Microscopy and Imaging Research
University of California, San Diego
http://ncmir.ucsd.edu/
"The truth shall set you free, but first it will piss you off"
A Landmark instructor
==================================================================
==========================================================================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".