Hi Ivaylo,

My first suggestion is that you should point out more
precisely where is the core of this probrem.

Which object, which method works fine and which doesn't?

I also suggest you that you can easily test if background
is partialy working or not at all using setColor() method.
If you can see background color, renderer sees your
background node, and I suppose your imageComponent2D
may not be prepared correctly. If you can't, I suspect
your scene graph may be incorrect.

And also you can check if your image is loaded correcly
by painting it on a AWT component, and can see your
scene graph tree with a small method like this :

 public static void dumpTree(PrintStream out, int indent, Node node) {
  for (int i = 0; i < indent; i++) {
   out.print(" ");
  }
  out.println(node.getClass());
  if (node instanceof Group) {
   Enumeration e = ((Group)node).getAllChildren();
   while (e.hasMoreElements()) {
    dumpTree(out, indent + 2, (Node)e.nextElement());
   }
  }
 }

With this dumping, a small trick like

class BackgroundGroup extends BranchGroup {
}
Group yourGroupForBackground = new BackgroundGroup();

should be useful because this dumpTree() prints only class
names.

Goodluck,

Tomohiro Koike

----- Original Message -----
From: Ivaylo Velikov <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 26, 1999 5:08 AM
Subject: [JAVA3D] Problems making image background


> Hello colleagues,
>
> This message is being resent, because of some "undeliverable" responses,
> caused by incorrect name entered from my side.
> Please, forgive my ignorance.
>
> I want to make an image background in Java3D through the following piece
of
> code.
>
> Group scene = new Group( );
>
> ImageComponent2D imageComponent = new ImageComponent2D;
> TextureLoader texLoader = new TextureLoader( "clouds.jpg", this );
> imageComponent = texLoader.getImage();
>
> BoundingSphere worldBounds = new BoundingSphere( new Point3d( 0.0, 0.0,
0.0
>  ), 5000.0 );
>
> Background background = new Background( );
>
> background.setImage( image );
> background.setApplicationBounds( worldBounds );
>
> scene.addChild( background );
>
> The scene then is added to the root.
> The program is compiled without any problems, the scene appears but with
no
>  background at all.
> No exceptions occurred. Everything seems to be allright, but it's not.
> Could anybody make some suggestions about the reason of such a problem?
>
> Thanks.
>
> Ivailo Velikov
>
>
===========================================================================
> 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".
>

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