Here is a snippet that creates a Sphere rather than using a model:
BranchGroup bgGeometry = new BranchGroup();
Appearance App = new Appearance();
try {
Texture tex = new TextureLoader(new java.net.URL(YOUR_BACKGROUND_IMAGE),
this).getTexture();
App.setTexture(tex);
}
catch (Exception e)
{
e.printStackTrace();
}
Sphere outerWorld = new Sphere( 1.0f, Primitive.GENERATE_TEXTURE_COORDS |
Primitive.GENERATE_NORMALS_INWARD, App);
bgGeometry.addChild(outerWorld);
Background bg = new Background();
bg.setApplicationBounds(bounds);
bg.setGeometry(bgGeometry);
objRoot.addChild(bg);
-----Original Message-----
From: Jeremy Booth [mailto:[EMAIL PROTECTED]
Sent: 10 June 2003 15:06
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] "rotating" background
Flavius Alecu wrote:
> one thing i'm not sure i understand....
>
> the line of code inside the try block..you load a model, what is that modell? is
> that the background with the stars?? I have mine in a .jpg bitmap =/
>
that model is simply a cube, with the normals facing in, then the texture
applied, the eight vertecies are
-0.7 -0.7 -0.7
-0.7 0.7 -0.7
0.7 0.7 -0.7
0.7 -0.7 -0.7
-0.7 -0.7 0.7
-0.7 0.7 0.7
0.7 0.7 0.7
0.7 -0.7 0.7
my star field is a jpg too.
HTH
Jeremy
--
Homepage: http://www.computerbooth.com/
Code page: http://www.newdawnsoftware.com/
===========================================================================
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".