Zak,
To Apply a texture to a sphere, you have to set the primflags when you create
the sphere.
I don't know what all the flags mean, so I just turn them all on.
int primflags=0xFF;
Sphere sphere = new Sphere(0.5f, primflags, ap);
The AppearanceTest example hides this little problem by using a Tetrahedron
class that
doesn't need primflags.
When you create the texture you can set it to various things like RGB, RGBA,
LUMINANCE etc. and
you can set TextureAttributes to MODULATE if you want light to work.
TextureLoader loader = new TextureLoader("K:\\3d\\Arizona.jpg", "RGB",new
Container());
Texture texture = loader.getTexture();
texture.setBoundaryModeS(Texture.WRAP);
texture.setBoundaryModeT(Texture.WRAP);
texture.setBoundaryColor( new Color4f( 0.0f, 1.0f, 0.0f, 0.0f ) );
ap.setTexture(texture);
TextureAttributes texAttr = new TextureAttributes();
texAttr.setTextureMode(TextureAttributes.MODULATE);
//texAttr.setTextureBlendColor(new Color4f(0.5f, 0.5f, 0.5f, 0.5f));
//texAttr.setTextureMode(TextureAttributes.BLEND);
//texAttr.setTextureMode(TextureAttributes.DECAL);
ap.setTextureAttributes(texAttr);
There are a lot of options to set, and you just have to play around with them
until you
get something that looks OK. Different versions of java 3d and different
platforms
interpret textures diffently, so you have to experiment a bit!
Regards,
Greg
Java3D.org
>>I have tried to apply any type of lighting to a textured sphere. Is =
>>there anything(capabilities, etc.) that I have to set for the lights to =
>>apply to the texture?
>>
>>Thanks,
>>Zak
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.
===========================================================================
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".