Hi folks.
The following code will not place a texture (that I can see anyway onto an object)
Appearance appearance = (Appearance)shape3D.getAppearance();
TextureLoader loader = new TextureLoader(directoryString,applet); //applet is the
applet used for this program
ImageComponent2D image = loader.getImage();
if(image == null) {
System.out.println("load failed for texture: "+directoryString);
// never gets into here ... good
}
//Texture texture = appearance.getTexture(); // try this out gives null
therefore there is no texture object yet
Texture2D texture = new Texture2D(Texture.BASE_LEVEL,
Texture.RGBA,image.getWidth(), image.getHeight());
texture.setBoundaryModeS(Texture.WRAP); //THIS IS THE DEFAULT ANYWAY
texture.setBoundaryModeT(Texture.WRAP); //THIS IS THE DEFAULT ANYWAY
texture.setImage(0, image);
appearance.setTexture(texture);
appearance.setTextureAttributes(new TextureAttributes()); // do I have to do
this?? it doesnt seem to make a difference
// shape3D.setAppearance(appearance); //does not have to be done
This code works fine on the individual shape3D objects of a Box object (I use a Box
object for the walls of a room).
But wont work on any imported objects. (ie the tables and chairs)
Is there anything else I have to set within the shape3D inorder to allow me to render
this texture?
I can change the material properties of the shape3D easily enough (there is already a
material object present in the appearance object)
Thanks for getting this far down the page
Cheers
Adrian
===========================================================================
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".