Steve,
You're quite right, I should rephrase the description of the problem, and
I'll add your comments to provide a bit more background.
Thanks for your comments.
Daniel Selman.
Tornado Labs Ltd.
Email: [EMAIL PROTECTED]
Web: www.tornadolabs.com
Phone: +44 (0131) 343 2513
Fax: +44 07070 800 483
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 19 March 1999 15:12
To: [EMAIL PROTECTED]
Cc: Paul Wagner; [EMAIL PROTECTED]
Subject: Re: [java3d] Benchmark
The explanation on the web page for why Java 3D is slowing down is a little
misleading. The problem isn't with creating the Shape3D nodes. It's with
the
setMaterial() method call for the Appearance object.
>From a previous discussion about this, I wrote:
>I screwed around with your code for a while, and I think I know what's
going
>on. It's not that the Shape3D's are taking so long to create. It's how
the
>Materials are kept internally.
>I un-commented your "m_Appearance.setMaterial(m_Material)" line and ran the
>program. Every time I hit quit (on my Unix box I set it to
control-backslash), I got a stack trace
>(which is a handy trick to know just in general, not just for this.
Anywho,
>when the program started slow down, and I hit quit, the program was nearly
>always showed the following:
>
> at java.lang.System.arraycopy(Native Method)
> at java.util.ArrayList.remove(Compiled Code)
> at javax.media.j3d.NodeComponentRetained.removeUser(Compiled Code)
> at javax.media.j3d.AppearanceRetained.setMaterial(Compiled Code)
> at javax.media.j3d.Appearance.setMaterial(Compiled Code)
> at CVoxel.<init>(Compiled Code)
> at CVoxel.main(Compiled Code)
>
>Or, at least something that it was in the process of doing in conjunction
with
>the setMaterial call. It could just be that the ArrayList is not set to
>anything beyond the default value, and is constantly in the process of
growing
>it's value by one.
>
>One way around this is to preallocate all your common Appearances (which I
>assume would be less than 4000), and pass those of when you create the
Shape3D
>objects. I allocated one appearance and used that for all 4000 objects
that
>were created, and it ran just as fast as the version of your program with
all
>the comments in place.
Daniel Selman wrote:
> Paul,
>
> Our benchmarking applet is available (with results and sources) here:
> http://www.tornadolabs.com/java/java3ddocs.html
>
> It is pretty rough and ready - but it does override the methods in
Canvas3D
> that you probably need.
>
> Let me know if you need further guidance.
>
> Daniel Selman
> Tornado Labs Ltd.
>
> Email: [EMAIL PROTECTED]
> Web: www.tornadolabs.com
> Phone: +44 (0131) 343 2513
> Fax: +44 07070 800 483
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Paul Wagner
> Sent: 17 March 1999 20:33
> To: [EMAIL PROTECTED]
> Subject: [java3d] Benchmark
>
> Hi all,
>
> I'm not very adept at the more esoteric areas of java programming, so I
> hope one (or more) of you can help me with a serious brick wall I've hit.
>
> I'm writing a 3D benchmark app/applet for testing 3D performance. What I
> want to do is build up a display list of triangles, collect the time data
> when the VM begins and stops rendering, and then calculate and display the
> difference as a frame rate or tris per second rate.
>
> Problem is this... I don't know how to collect the timing data once the VM
> starts doing it's thing-(to begin timing immediately before rendering and
> stop timing upon completion of rendering). I assume I need to put some
> special methods in my code to wake it up to execute the time collections
> and calculations _after_ the app has begun running. Thing is, I'm not
sure
> how.
>
> If anyone has a good example of this kind of thing, or knows some
resources
> that might shed some light on my dilemma, I'd be ever so grateful to hear
> from you.
>
> Much thanks,
> Paul Wagner
> 3D Pipeline Co.
> [EMAIL PROTECTED]
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
> =====================================================================
> To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
> Java 3D Home Page: http://java.sun.com/products/java-media/3D/
--
Steve Pietrowicz - [EMAIL PROTECTED] Project Manager - NCSA Java 3D Group
NCSA Portfolio: http://havefun.ncsa.uiuc.edu/Java3D/portfolio/
New Beta 2a release! New Loaders, record and replay of your
Java 3D apps 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
Java News Network: http://tintoy.ncsa.uiuc.edu/~srp/java/javanews.html
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/