How are you generating your starfield?  It sounds like it's just a bitmap.
I did some work on this a few months back and borrowed ideas I'd seen from
Orbit, OpenUniverse, and Celestia.  At first, I'd tried to use a JPG of the
Tycho starfield, but it looked terrible and was slow.

Instead, render your distant stars as points.  Orbit used varying pixel
sizes for each star, depending on luminosity.  With the PointArrays that I
was using, that wasn't quite as easy to do.  So I simulated luminosity with
the color value at someone's (Artur's?) suggestion.

Take a look at the BackgroundApp demo that comes with Sun's Java3D tutorial
(../examples/easyContent/BackgroundApp.java).  You'll see code similar to
this:

  public BranchGroup createBackGraph()
  {
    // Create the root of the branch graph
    BranchGroup objRoot = new BranchGroup();

    PointArray starGeom1 = new PointArray(7, PointArray.COORDINATES);
    Appearance starAppear1 = new Appearance();
    starGeom1.setCoordinate( 0, new Point3f( 0.79483311f, -0.58810995f,
0.14955615f));
    starGeom1.setCoordinate( 1, new Point3f(
0.44430932f, -0.55736839f, -0.70137505f));
    starGeom1.setCoordinate( 2, new Point3f( 0.94901367f, -0.30404968f,
0.08322775f));
    starGeom1.setCoordinate( 3, new Point3f( 0.68060123f, -0.43044807f,
0.59287173f));
    starGeom1.setCoordinate( 4, new Point3f(-0.11641672f,  0.47273532f,
0.87348049f));
    starGeom1.setCoordinate( 5, new Point3f(-0.10399289f, -0.98059412f,
0.16619437f));
    starGeom1.setCoordinate( 6, new Point3f(
0.08024400f, -0.96944100f, -0.23182900f));
    PointAttributes point1 = new PointAttributes(4.0f, false);
    starAppear1.setPointAttributes(point1);
    objRoot.addChild(new Shape3D(starGeom1, starAppear1));
..etc...

Next, if you want a *real* starmap, get a copy of the HIPPARCOS dataset and
plot the closest 2000 stars.  You'll be amazed at how good it looks and how
fast it is.  I'd suggest doing what Chris Laurel did with Celestia - parse
the db and convert it to a binary format, storing only those values you'll
need.  The database is about 14 megs unzipped and in plain text.  HIPPARCOS
contains data for 200,000 stars.

And if you haven't seen it yet, take a look at Celestia.  First run the demo
mode and be WOWED when he flies you out of the galaxy.  Then fly out to the
star "Tau Bootis" and see an extra-solar planet.  Very very cool.


----- Original Message -----
From: "Christian Bartel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 1:18 AM
Subject: [JAVA3D] Background Geometry


> Hi Professionals :)
>
> I am a beginner in Java3D and have the following question:
>
> Situation:
> I set up a somewhat nice-looking solar-system so far. There are spinning
> planets and they're rotating around a sun. I can move the viewing-platform
> by mouse-movements. Now I used a background-geometry to put an image
> (starfield) to the background that would move as the mouse would change
the
> position of the viewing-platform.
>
> BUT: This is unacceptable slow. If I use no Background I can smoothly move
> up to 10 Planets (spinning and rotating with textures). But as soon as the
> background comes in, everything gets really bad :(
>
> Has this something to do with the size of the texture? I mean the amount
of
> time that is needed to stretch it onto the inner side of the backgrounds
> sphere?
>
> I used pretty exactly the implementation of the API-example that is
schowing
> the use of that feature...
>
> Am I missing something? Or is there another way to implement what I
wanted?
>
> Thank you all!
>
> Greetings,
>         Christian Bartel
>
>
===========================================================================
> 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".


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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