I've implemented picking and changing colors of individual polygons using
the GeomInfoApp example from the Java3D Tutorial (available from the sun
website).  The little car in the example has two sides, a roof, hood, trunk,
and front and back windows.  My picking routine doesn't work very reliably,
and depends on where I position the mouse when I click.  I've attached the
code in hopes that someone can point out my error.  It should compile and
run OK.

Daniel

(look at bottom for files...)

-----Original Message-----
From: Bruno Sousa Caiado [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 19, 2000 11:30 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] many shape3d objects


Hello,
I had a similar problem with my project and i solved it using the Indexed
geometry classes provided by j3d. With this classes you put as many polygons
as you want in one shape3D (check out the IndexedGeometryArray class in the
API)

As far as changing the appearance of the individual polygons, you can change
their color if you�re able to know what are the vertices that belong to the
polygon in question. All you have to do is use an array to map the color
onto the vertices (as opposed to using the appearance to set the color...)
and then change the color at the specified indices of the array...
Hope it helps...
Good luck and good work...

Bruno Caiado

----- Original Message -----
From: Dvorak, Daniel J. <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 19, 2000 3:38 PM
Subject: [JAVA3D] many shape3d objects


> In my project, I need to draw about 30000 polygons, each individually
> pickable.  When a polygon is picked, I change the color by changing the
> appearance reference.  Currently I create a Shape3D for each polygon, and
> this requires about 160Mb of RAM.  I think the huge memory requirement is
> due to the number of Shape3D objects.  Is there a way to create all my
> geometry using one Shape3D and still have the ability to change appearance
> of individual polygons?
>
> Daniel
>
>

PickBehavior.class

PickBehavior.java

Small.class

Small.java

Reply via email to