Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic Object Visibility in Java3D
    text
    copied!<p>I'm using Java and Java3D to build a relatively simple model of the Milky Way galaxy that can be "flown" through.</p> <p>So far I have a naive version working that reads in 40,000 known stars and displays them (with keyboard+mouse navigation) as Sphere objects. However, there are several problems blocking further progress.</p> <p>One of the problems I'm struggling with is that I need to render stars according to their apparent magnitude, which is a function of a star's absolute magnitude of brightness (logarithmic scale) and its current distance from the observer. Stars with a very low apparent magnitude (such as Proxima Centauri as seen from Earth orbit) should be invisible, while extremely bright stars (such as Deneb) should be visible even at a relatively large distance from Earth.</p> <p>So I can't just display stars based on their fixed "actual" size and their distance from the current observation location. This results in giant blobs for even very dim close stars, while insanely luminous stars like Deneb don't display at all because of their distance.</p> <p>The question is, how can I represent the image of a star based on its apparent magnitude, which changes according to its distance from the current viewpoint position, without dynamically allocating and deleting Java3d objects? Or, if I have to change objects in Java3D after rendering has begun, how can I do that without killing my frame rate?</p> <p>I've tried using transparency; that just makes giant circles a little harder to see. I've tried using fog, but that fogs out distant stars (and constellation lines) completely. I've tried converting Spheres to Shape3D objects, but that eats up twice the heap space.</p> <p>One happy special case is that I don't need to display any star whose apparent magnitude is larger than 7.00, since the human eye can't see them. In theory, I should only need to generate a 3D object for any thing that I can see based on my current position in space. Not only would this improve performance over creating a Sphere object for every star in the database, it would help me avoid running out of Java heap space. (I have over 100,000 real stars I'd like to include, but I'm running out of heap space after 40,000 and no Java setting I've tried is giving me more heap space.)</p> <p>I know that this sort of dynamic display of star brightness is possible. The creator of the remarkable Space Engine simulation program does it (AND manages to get 60 frames per second). I just can't for the life of me figure out <em>how</em> he does it.</p> <p>I fully expect that I've hit the limits of my naive implementation and that the only way to get acceptable performance and functionality is to redesign the entire display concept. I'd love to see some specific answers for how to do dynamic object visibility using Java3D, but at this point I'll settle for expert speculation. (I'd prefer not to abandon Java3D, but I'm open to specific recommendations there as well.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload