One thing you can try is to cut down on the number of polygons in the scene by
not using the default values for the cylinder and sphere subdivisions.   The
defaults are high, and you can get away with using much lower numbers.  eg:


     cylinder = new Cylinder(radius, height, Cylinder.GENERATE_NORMALS, 15, 1,
app);

Steve



Bob Gray wrote:

> I am writing a molecular viewer type program with Java 3D.
>
> I allow up to 2,000 cylinders (bonds) to be displayed and
> about 500 spheres (atoms).
>
> I wrote my own cylinder geometry objects using quadarrays.
>
> When I display the maximum number of cylinders, performance is very poor.
> (Actually, performance is very poor well before I reach the maximum....)
> Rotations are very choppy.  Resizing all the cylinder diameters takes
> forever.
>
> So I could use some help on programming Java 3D for *performance*.
>
> I read the on-line performance suggestions (but I don't remember which one)
> which recommended rotating the viewing platform rather than all the objects.
> I did this and rotation of the scene is still very poor.
>
> Is it better (performance wise) to define the geometry of one cylinder along
> the z-axis, for example, and then add 2000 transforms to the scenegraph to
> rotate and translate
> the cylinder to each position, or is it better (as I have done) to  define
> the
> quadarray for each cylinder in its final position, so there is no transforms
> in the
> scene graph for positioning the cylinders, but there are lots (2000) of
> cylinder Shape3D objects defined?
>
> I am running on a Pentium 500 MHz processor.  Should I be experiencing
> really bad
> performance problems with 2,000 cylinders in the scene graph?
>
> When I change the diameter of all the cylinders, I currently redefine all
> the geometry,
> creating new Shape3D objects with the new diameter.  A scale transform wont
> work,
> I think, because the lengths do not change.  It takes for ever....  Is there
> a
> better way to do this??
>
> Bob Gray
>
> ===========================================================================
> 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".

--
Steve Pietrowicz - [EMAIL PROTECTED]    Project Manager - NCSA Java 3D Group

NCSA Portfolio 1.3 beta 2:  http://havefun.ncsa.uiuc.edu/Java3D/portfolio/
   New Loaders, turn your Canvas3D into a JPEG, new InputDevices and more!
   Freely available for non-commercial use!

You Build It VR:     http://havefun.ncsa.uiuc.edu/Java3D/YouBuildItVR/
   Build your own multi-user virtual worlds with no programming experience!
The Java3D FAQ:      http://tintoy.ncsa.uiuc.edu/~srp/java3d/faq.html

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