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