Thanks Alessandro,
I realized the point last night and you are right, the Shape3ds are under
the TransformGroups.
I want to send new "kur" function, maybe it helps some people:
private void kur3 (Scene sce) {
BranchGroup branch = sce.getSceneGroup();
int a = 0;
for (Enumeration e = branch.getAllChildren(); e.hasMoreElements(); ) {
Object obj = e.nextElement();
System.out.println(obj.toString());
if (obj != null && (obj instanceof TransformGroup)) {
TransformGroup tg = (TransformGroup)obj;
for (Enumeration ee = tg.getAllChildren();ee.hasMoreElements();) {
Object newObj = ee.nextElement();
System.out.println("**" + newObj.toString());
if (newObj != null && (newObj instanceof Shape3D)) {
Shape3D shape = (Shape3D) newObj;
shape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shape.setCapability(Shape3D.ENABLE_PICK_REPORTING);
shape.setCapability(Shape3D.ALLOW_PICKABLE_READ);
shape.setCapability(Shape3D.ALLOW_PICKABLE_WRITE);
shape.setCapability(Shape3D.ALLOW_LOCAL_TO_VWORLD_READ);
PickTool.setCapabilities(shape, PickTool.INTERSECT_FULL);
}
}
}
}
}
From: Alessandro Borges <[EMAIL PROTECTED]>
Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Lw3dLoader problem
Date: Mon, 28 Jul 2003 14:54:04 -0300
Nagehan,
I suspect you have also some TransformGroups inside your lws scene.
The vrml models are all TGs, the OBJ are Shapes3D, maybe LWS has both.
Alessandro
----- Original Message -----
From: "nagehan pala" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 28, 2003 1:51 PM
Subject: [JAVA3D] Lw3dLoader problem
> hi friends
>
> I changed my "kur" function:
>
> private void kur2 (Scene sce, String st) {
> // Hashtable hash = sce.getNamedObjects();
> BranchGroup branch = sce.getSceneGroup();
> int a = 0;
> for (Enumeration e = branch.getAllChildren(); e.hasMoreElements(); )
{
> Object obj = e.nextElement();
> if (obj != null && (obj instanceof Shape3D)) {
> Shape3D shape = (Shape3D) obj;
> shape.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
> shape.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
> shape.setCapability(Shape3D.ENABLE_PICK_REPORTING);
> shape.setCapability(Shape3D.ALLOW_PICKABLE_READ);
> shape.setCapability(Shape3D.ALLOW_PICKABLE_WRITE);
> shape.setCapability(Shape3D.ALLOW_LOCAL_TO_VWORLD_READ);
> PickTool.setCapabilities(shape, PickTool.INTERSECT_FULL);
> }
> else
> System.out.println("not Shape3D" + st);
> a++;
> }
> System.out.println("There are " + a + "objcets") ;
> }
>
> Also, it is not work, but the output of the program is surprising:
>
> not Shape3D box.lws
> not Shape3D box.lws
> not Shape3D box.lws
> not Shape3D box.lws
> not Shape3D box.lws
> There are 5objcets
>
> does this mean that:there is no Shape3D object in .lws file?There is a
box
> in it!!!!
>
> I know that the geometry information is hold in .lwo files, could anyone
> help me?
>
> _________________________________________________________________
> MSN 8 with e-mail virus protection service: 2 months FREE*
> http://join.msn.com/?page=features/virus
>
>
===========================================================================
> 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".
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
===========================================================================
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".