I'm making a starfield for my
background. I was looking at some of the examples in the Tutorial and came
across this:
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));
This looked liked what I needed, at
first. However, it seems that I can only set one appearance per
point. The data that I have currently is the (x,y,z) of the star and a
magnitude value. I suppose I can round off the magnitude values and create
geometry in "clumps" of similiarly bright stars, but I'd also like to add in
color -- if I can find the data. Does anyone have any suggestions?
Currently, I've got realistic data for 2000 stars visible to us from
Earth.