(1) Triagulator.java

In Java3d 1.2, which was closed source, you were encouraged to manually invoke
Triangulator(), with 3 possible constant arguments, one of which was
"EARS_SORTED". Going through the 1.3 source, notably com.sun.j3d.utils.geometry,
other than the obvious fact that manual invocation of Triangulator is now
depreciated, it turns out they never implemented EARS_SORTED in the first place.
You also see that their triangulation code is based on Martin Held's robust C
Triangulation package, "FIST" (which is a basically a well written ear clipping
routine, the source for which is available on request). Comparing sources, it
seems very odd the way Sun have translated his code - single length arrays in
place of pointers to primitives, copied and pasted code comments, directly
copied and odd / hard to follow looping and array indexing. Did Sun just run his
code through a C to Java source converter, clean it up a bit, delete the 'hard'
parts (eg EARS_SORTED), and bung it in Java3d?

Either way, the Triangulator right now seems a mess. In fact I'd say that about
the whole of the utils.geometry package, a good portion of which is just a
scrappy source conversion of Martin's code.

Pointless rant I know, but I don't see why EARS_SORTED wasn't implemented. It
would amount to uncommenting some stuff and maintaining the sorted property of
the ear heap (not rocket science), of course with direct reference to Martin's
implementation :-) <goes off to do it himself instead of whining>


(2) How do manage 1000's of simple objects

If I want to set up a very simple real time simulation (as in, simulating a
system in time and space, where the objects are simple but numerous) in Java3d,
what would be the quickest way of updating the position of a 'massive' number of
geometrically simple and identical or almost identical moving objects?

I could toy with various tricks and hacks for weeks, but I assume this is a
wheel that has been invented many times before. Anchoring each object under its
own transform and updating thousands of transforms seems silly - do I want to
have a single transform, attach everything to that, and then access each
object's co-ordinates directly? I have noted the "BY_REFERENCE" update method
whilst perusing the API's, but this seems to limit my own engine's ability to
fiddle with it's own data. Is there some magical piece of synchronization code
someone has discovered that lets the engine meddle with its (Java3D referenced
arrays), and then tells Java3D when to look at them?

Oh, one other thought I just had whilst writing this - removing, updating, and
reattaching the Shape once per engine tick. Is this an absurd idea?

Have I got the wrong idea in wanting to use Java3d as a quick way of displaying
what my underlying engine is calculating? If I use Java3d, should everything be
'within' Java3d? By that I mean use behaviors for movement updates, have all
the engine controlled objects as direct parts of the scenegraph (and so on). It
just seems that this would defeat the original purpose (handling as many engine
objects as possible as fast as possible, all within Java).

I would be tempted to set up a traditional "game loop" system, where my
updataGraphics() uses direct OpenGL calls when *I* want (perhaps through JOGL?),
if it wasn't for some other massively convenient Java3D features I
plan on using.

Any tips? I hope I have struck the right balance between "UTFSE" and wasting
disproportionate amounts of time re-inventing the wheel. Oh and for
the sake of argument, when I say simple object, let's assume we could
go right down to 'cone', or 'box', 'triangle' even, on the off chance
that would induce some different replies :-)

(3) Transform the View, not the Scene?

Oh and one other question which is going to make me look *very* dumb. I am using
the MouseTranslate convenience class at present to "pan" the world view. But I
seem to be doing it the wrong way round - I have attached it to the root
transform, and specified a huge activation radius so everything gets
transformed. So I am in fact transforming the whole world each time. Don't I
want be transforming just the view? I have tried to hook MouseTranslate up to
the View but with no luck. Again, have I got the wrong idea?

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