Skip to main content

how to hide 3d objects

1 reply [Last post]
adamtdisplay
Offline
Joined: 2011-02-02
Points: 0

Dear All,

I'm new to Java 3d and am currently building an application where i want to be able to hide objects within the Vitual Universe by highlihgting a CheckBox in the UI which is already in position, similar to most 3d design packages - turning the layers on/off. I believe i am unable to use the likes of setVisible(false) and wondered if anyone had any suggestions

Also, i am aware of Switch but wondered if there was another/easier method

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
interactivemesh
Offline
Joined: 2006-06-07
Points: 0

Hi,

visibility can also be managed as follows:

- RenderingAttributes

Add a RenderingAttributes instance to the Shape3D's Appearance and call 'RenderingAttributes.setVisible(boolean visible)'. A single instance can be shared by adding it to several Apearances so that their Shape3D's visibility will be synchronized.

- SharedGroup and Link

Add the objects to SharedGroups and link them via a Link node to their parent in the scene graph. When calling 'Link.setSharedGroup(mySharedGroup)' the object(s) will be visible and when calling 'Link.setSharedGroup(null)' they will be invisible.

August