David,

I modified my example to create two spheres one with radius 1.0 (near) and
one with radius 1.2 (far).

I have attached the screen shots that I got by first rendering the far
sphere, and then adding the near sphere. As you can see, the textures have
been blended to create the composite as you would expect.

Is this what you are looking for? I'm guessing your near texture image has
some transparency using the alpha channel to create partially opaque clouds
which you can then animate through the Transform3D on the TextureAttribute.
I'd like to see a screen shot if you get it working - sounds cool.

I'm thinking about your other problem, as far as I know it should work...

Sincerely,

Daniel Selman

[EMAIL PROTECTED]

Tornado Labs Ltd.
http://www.tornadolabs.com



        public void createBackground( Group bg )
        {
                // add the sky backdrop
                Background back = new Background();
                back.setApplicationBounds( getBoundingSphere() );
                bg.addChild( back );

                BranchGroup bgGeometry = new BranchGroup();

                // create an appearance and assign the texture image
                Appearance app1 = new Appearance();
                Texture tex1 = new TextureLoader( "back1.jpg", this).getTexture();
                app1.setTexture( tex1 );
                app1.setTransparencyAttributes( new TransparencyAttributes(
TransparencyAttributes.NICEST, 0.5f ) );
                app1.setTextureAttributes( new TextureAttributes( 
TextureAttributes.DECAL,
new Transform3D(), new Color4f( 0,0,0, 0.5f ), TextureAttributes.NICEST ) );

                Appearance app2 = new Appearance();
                Texture tex2 = new TextureLoader( "back2.jpg", this).getTexture();
                app2.setTexture( tex2 );

                Sphere sphere1 = new Sphere( 1.0f, Primitive.GENERATE_TEXTURE_COORDS |
Primitive.GENERATE_NORMALS_INWARD, app1 );
                Sphere sphere2 = new Sphere( 1.2f, Primitive.GENERATE_TEXTURE_COORDS |
Primitive.GENERATE_NORMALS_INWARD, app2 );

                bgGeometry.addChild( sphere1 );
                bgGeometry.addChild( sphere2 );

                back.setGeometry( bgGeometry );
        }

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of David
Sent: Saturday, December 23, 2000 11:35 AM
To: [EMAIL PROTECTED]
Subject: Re: Background geometry question


Thanks for your reply Daniel.  Nope can't keep away.  This project has at
least another year of development, so I will be bugging all of you for a
time yet :).

Your example is similar to example they have in the demo, but my geometry is
much more complex.  I find the sphere to be bad for my purposes because of
the pinching.  My tessalated dome is a bit different in construction.  I
also have 2 domes one inside the other, for separate rendering of clouds
from sky/sun/stars.  That way I can move and transform the clouds, separate
from the sky colors, etc.  The clouds are alpha blended so the sky shows
through.

I just don't see what the difference is unless Java3d only supports a unit
sphere as background geometry.  Does anyone know if yu can put arbitrary
geometry in the background?

Dave Yazel
----- Original Message -----
From: Daniel Selman <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 23, 2000 12:41 PM
Subject: Re: [JAVA3D] Background geometry question


David,

...just can't keep away, huh? ;-)

I have used background geometry for something similar to what you describe.
I create a unit Sphere (flip the normals) and then set it as background
geometry. The inside of the sphere is texture mapped with an image of
clouds.

Sincerely,

Daniel Selman

[EMAIL PROTECTED]

Tornado Labs Ltd.
http://www.tornadolabs.com

Here is some example code:

        public void createBackground( Group bg )
        {
                // add the sky backdrop
                Background back = new Background();
                back.setApplicationBounds( getBoundingSphere() );
                bg.addChild( back );

                BranchGroup bgGeometry = new BranchGroup();

                // create an appearance and assign the texture image
                Appearance app = new Appearance();
                Texture tex = new TextureLoader( "back.jpg",
this).getTexture();
                app.setTexture( tex );

                // render as a wireframe
                /*
                PolygonAttributes polyAttrbutes = new PolygonAttributes();



             polyAttrbutes.setPolygonMode( PolygonAttributes.POLYGON_LINE );
                polyAttrbutes.setCullFace( PolygonAttributes.CULL_NONE ) ;
                app.setPolygonAttributes( polyAttrbutes );
                */

                Sphere sphere = new Sphere( 1.0f,
Primitive.GENERATE_TEXTURE_COORDS |
Primitive.GENERATE_NORMALS_INWARD, app );

                bgGeometry.addChild( sphere );
                back.setGeometry( bgGeometry );
        }


-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of David
Sent: Saturday, December 23, 2000 12:02 AM
To: [EMAIL PROTECTED]
Subject: Background geometry question


Hi all, hope your holidays are going well!

I am working on the sky, sun, clouds, etc for Cosm and had a couple of
questions.  I have a tesselated dome which renders fine when placed in the
main scene graph and was wondering if this is something I could move to the
background object.

I did try to move it there, but it does not render.  I could move the dome
in the main scene graph when the user moves, to keep him at the "center",
but the issues I have are with clipping.  My distance terrain is currently
using rendering attributes to define a circle of invisible terrain cells
(because close cells are rendered at higher detail) and I depend on clipping
to prune distance terrain at a user definable setting.  Unfortunatly this
also would clip my sky dome.

So a few questions:

1. Can I use a clip node to apply clip to just my sub-tree with the terrain?

2. Can I put my geometry in the background node?

3. Can I somehow clip everything normally, but elect to not clip my sky
dome?

How have other people addressed this?

Dave Yazel
Cosm Development Team

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

near_far.jpg

far.jpg

Reply via email to