> Date:         Wed, 26 Mar 2003 22:50:21 -0000
> From: David Roberts <[EMAIL PROTECTED]>
>
> Hi has anyone got any experience using Locales - or should I be
> knocking up complex demos and benchmarking?  Could someone on the
> Java3D team comment, cause I can't find anyone who's ever used a large
> number of locales.

"Java 3D Programming" by Daniel Selman has example source code you can
download from http://www.manning.com/selman.  Look for
HiResCoordTest.java.  It uses the solar system as an example, but only
creates 3 Locales.

Unfortunately there doesn't seem to be a lot of collective experience
being shared here on the list, and we don't have any public code
relevant to your question that we can share.

We have fixed numerous customer-reported bugs relating to HiResCoords
and multiple Locales since 1.1, so there are apparently people out there
using them.  We can't generally distribute the test programs that people
submit, but if you go to the bug database and search for Locale and/or
HiResCoord you might be able to get some public information and perhaps
contact the bug submitters.

> a) Can you see geometry in a locale other than the one the ViewPlatform
> is attached to?

Yes.  But results may be imprecise depending upon the distance between
the Locale origins and the scaling between them, and you may have
trouble with Z-buffer precision.  For the 16-bit Z buffers commonly
found on consumer-level hardware, you'll need to keep the ratio of the
far clip plane distance to the near clip plane distance less than about
3000.

OpenGL doesn't specify how floating point numbers are represented
internally by the graphics hardware -- it only requires that the result
of any single floating point computation be precise to about 1 part in
100,000.  This is worse than IEEE single-precision floating point, but
you probably can't count on it being much better with cheap gaming
cards.  "Workstation-class" cards designed for CAD and high-end
visualization generally have much better precision, although the exact
numbers seem to be unavailable from most vendors.

Game programmers of course have been working around this limitation for
years.  They don't try to model real-world units on the scale of the
earth or the solar system -- things that are sufficiently far away get
painted as backgrounds; things that are really close get rendered as
overlays.  Objects may be scaled larger or smaller than they really are
so that the appear to be the correct size at distances that fall within
the precision bounds.

These gaming tricks can really complicate your application, but
unfortunately, you may have to adopt some of them if application needs
to run on consumer gaming cards, culling out objects from remote Locales
that can't be rendered precisely and substituting imposters instead.

> b) When the ViewPlatform is moved between Locales, does Java3D have to
> do a lot of work?

It should be about the same amount of work as detaching and reattaching
the ViewPlatform to the same Locale.

> c) When would it be best to move the ViewPlatform? post render or using
> a wakeonelapsedframes behaviour?

You should only modify the scene graph from a behavior.

> d) How large is it recommended to have the collection of Locales for a
> Universe and whats the insert and remove spped from this collection?

Unfortunately we haven't attempted to quantify the performance
characteristics of updating large numbers of Locales.  I hate to say it,
but you may be a pioneer here.

As an alternative to detaching and reattaching the ViewPlatform to
different Locales, you might explore using the Locale setHiRes() method
to update the origin of the Locale containing the ViewPlatform as it
traverses the solar system.  I think you might have to detach and
reattach the ViewPlatform to get the new origin to take effect, but it
should reduce the number of Locales you'll need.

Good luck, and let us know how it goes -- Mark Hood

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