Title: RE: [JAVA3D] how to check j3d rendering resource on fly, Detach a BrachGroup

For threads, see the tutorial in:

http://java.sun.com/docs/books/tutorial/essential/threads/

and the api doc in:

http://java.sun.com/j2se/1.4/docs/api/java/lang/Thread.html

For the other questions I'm not sure that I can give a good answer, but I assume that when the branchgroup is detached you don't need to remove its children as long as there are no other pointers to them. If only the removed branchgroup points to them, garbage collection should be able to detect and free them.

Pasi

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Lan Wu-Cavener
Sent: 12. marraskuuta 2002 19:51
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] how to check j3d rendering resource on fly, Detach
a BrachGroup


Pasi,

Thank you very much!
  Since this is the only reply I got. I would like to ask some more
questions. I am sure others have done this sort of things too. Any
suggestion is apprecited.

1. Does anyone has this type of sample code? I have not much experience
writing another thread. How to assign the priority to a thread?
2. How do I know the detaching of a grid is completed (how to check)?
Becuase when I put the detach code in a Behavior object as follows:
branchGroup is the one that I wanted to detach.
         branchGroup.detach();
         for( int ii = branchGroup.numChildren() - 1; ii >= 0; --i )
                 branchGroup.removeChild( ii );

I got the error that only BranchGroup can be removed. this means that the
branchGroup has not been fully detached (still alive). Otherwise, removing
children from a non-alive BranchGroup should be fine.

3. next question is more for java3D team. Can anyone explain what the
detach() function does in details. The reason I am asking is that I wanted
to re-use TransformGroup objects in detached BranchGroup to avoid time used
by garbage collecting.
If the detach() just break the top link of detached branchGroup to the
sceneGraph, I can move the whole detached branchGroup.

Thanks in advance for any comments!
Lan




At 08:28 AM 11/12/2002 +0200, you wrote:

>I'd put the detaching in a thread of its own and set a low priority for
>that thread. Then the detaching is done when there is CPU available.
>
>Pasi
>
>-----Original Message-----
>From: Discussion list for Java 3D API
>[<mailto:[EMAIL PROTECTED]>mailto:[EMAIL PROTECTED]]On
>Behalf Of Lan Wu-Cavener
>Sent: 11. marraskuuta 2002 17:20
>To: [EMAIL PROTECTED]
>Subject: [JAVA3D] how to check j3d rendering resource on fly
>
>Hi, everyone:
>
>I am using view frustum culling in my program. I will have to add some
>grids and detach some every frame. I wanted to make all the adding grids
>happening immediately. so I put the part of code into a Behavior object.
>But I want to make all the detaching happen when the rendering resource is
>not busy. My question is that how can I query the j3d VM to find out the 3D
>rendering resource status during the programming running.
>
>Thank you in advance!
>Lan
>
>Lan Wu-Cavener
>Dept. of Landscape Architecture
>
>===========================================================================
>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".

Lan Wu-Cavener
Dept. of Landscape Architecture

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