why creating sphere(6378f,Primitive.GENERATE_TEXTURE_COORDS, 800, app)
makes memory heap error? hmmm

I need to make earth sphere(6378.137,...., <2000?>,app) & make it possible
to zoom in & still get nice view (round)

Is there other way then using sphere to make it work?
When im doing it on shere(637......) it warks but when i start zooming out
texture stops to scale at some distance, how can i fix it?? (do i have to
make more textures with different size and load them all to memory?, is
there other way?)
Any links to java3d sites with demo code will make me happy

Thanks

code:
---------------------------------------------------------------------------
-----

Appearance createTwistAppearance(){
        Appearance twistAppear = new Appearance();
        String filename = "earth.jpg";
        System.out.println("attempt to load texture from file: "+filename);
        TextureLoader loader = new TextureLoader(filename, this);
        ImageComponent2D image = loader.getImage();
        if(image == null) {
            System.out.println("load failed for texture: "+filename);
        }
        Texture2D texture = new Texture2D(Texture.BASE_LEVEL,
                 texture.RGBA,image.getWidth(),image.getHeight());
        texture.setImage(0, image);
        texture.setEnable(true);
        texture.setMagFilter(Texture.BASE_LEVEL_LINEAR);
        texture.setMinFilter(Texture.BASE_LEVEL_LINEAR);
        twistAppear.setTexture(texture);
        return twistAppear;
 }
public BranchGroup createSceneGraph(SimpleUniverse su) {
 BranchGroup objRoot = new BranchGroup();
 Appearance app = new Appearance();
  TransformGroup TG = new TransformGroup();
 TG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
 objRoot.addChild(TG);
 Appearance appear = createTwistAppearance();
 TG.addChild(new Sphere(637.8137f,
                   Primitive.GENERATE_TEXTURE_COORDS,1000, appear));
 Movement movement = new Movement(su);
 objRoot.addChild(movement.getMouseRotate());
 objRoot.addChild(movement.getMouseTranslate());
 objRoot.addChild(movement.getMouseZoom());
 objRoot.addChild(movement.getKeyNavigator());
 BoundingSphere bounds = new BoundingSphere(new Point3d(),10000);
 Background background = new Background(1.0f, 1.0f, 1.0f);
 background.setApplicationBounds(bounds);
        objRoot.addChild(background);
 objRoot.compile();
 return objRoot;
}
public Ray3dApp(){
 setLayout(new BorderLayout());
 GraphicsConfiguration gConfig =
                     SimpleUniverse.getPreferredConfiguration();
 Canvas3D canvas3D = new Canvas3D(gConfig);
 add("Center",canvas3D);
 canvas3D.setStereoEnable(false);
 SimpleUniverse sUniverse = new SimpleUniverse(canvas3D);
 sUniverse.getViewingPlatform().setNominalViewingTransform();
 BranchGroup scene = createSceneGraph(sUniverse);
 sUniverse.addBranchGraph(scene);
}
public static void main(String[] args) {
 Frame frame = new MainFrame(new Ray3dApp(), 600, 600);
}

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