Morning all,
I've been looking at improving the performance of my old project as it looks like we
may be needing the code again for the next version of my friends PBeM game.
The basic context of the 3D components is to visualise information gathered on the
galaxy around you to aide your strategies and commands for the next turn.
Therefore the visuals are not accurate star charts but tactical displays.
At the moment the scene consists of a cube (100^3) containing up to 300 stars (as you
find them) and several hundred ships.
The stars are represented by their significant property;
An inhabitable world (Green)
An uninhabitable world that can be mined (Blue)
A supernova (white)
A blackhole (grey)
Everything is scaled so that you can see what they are from a distance.
At the moment I have three LODs for each;
A default sphere, textured & rotating (world), pulsing (nova)
A sphere with reduced facets, textured, pulsing
A pointArray with a single point size ~3 antialiased
Ships are simular using cones (I have some simple models for them but haven't sorted
out a loader yet).
Each object has a raster label in a switch so it can be turned on and off (different
colours for different players).
Basic scenegraph is like this;
RootObj_
\_StarsBG
| \_MyStarsBG
| | \_InhabBG
| \_OtherBG | \_Star1BG
\_ShipBG \_UnhabBG \_LOD
\_TG
\_StatSW------StarShape3ds
\LabelSW------Raster
I know that having a single PointArray with 300 points is more efficient then 300 of
them with 1 point but I need the stars to switch LOD independent of each other and
there's four different colours.
I have two lights one in front one behind, different levels/colours to help give a
more 3D effect.
You can switch on a transparent cube with a lineArray outline and a transparent
compass. The cube surrounds the 'galaxy' and the compass is in the centre so that you
can get a better idea of location/direction/limits. You can detach BGs like all ships,
other stars, my stars etc.
Navigation consists at the moment of;
Button1 drag - Rotates view
Button2 drag - Pans view
Button3 drag - Zooms view
Button1 click - Bring up properties of the Star
Button1 drag on a star - Orbits around star view
I get about 20fps with everything on with a GF3 card, about 4fps with an ATI
Rage128Pro. (rotate and pulse are off at the moment as they really hurt performance)
Using JDK1.4.0_01 & J3D1.3FCS.
Things I want to improve;
The pointArray LODs can be seen through the Sphere LODs that are in front (looks
wrong obviously :)
The transparent compass/axis can be seen through every thing else (not sure if I
like this or not)
The Raster labels can be seen through every thing else (this I can live with)
The orbit behaviour causes a 'jump' when you enter and leave it (very annoying)
More speed captain! :)
Replace the whole navigation system (haven't decided what modes yet)
For the new game I need to add multiple planets per star, probably only visible
when close up or clicked on, but I want them rotating the Star.
Activate the label when you pass the mouse over an object.
Even more speed captain!
Add more views, I can add another copy of the whole scene to another Tab in my
panel, and another etc but this isn't very efficient. Can
additional views of the same scene display different subsets of the scene or only
different
views?
Any ideas on things I can try or more code I can steal? :)
Thanks,
Jason.
PS Sorry for the length of the post.
==========================================================================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".