Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java3d: texture image not showing up on a box, whats wrong?

843799Apr 6 2008 — edited Apr 6 2008
Hello!
I am applying an appearence on a BOX.
For now it is only displaying a GREY colour and not my texture! Why?

It seems as I can see vaguely a small side of the box that its applied to one face only... how can I sort this?

(The image path and name are correct!)
 //debut test APPARENCE Wing Left
 
//test textures
// Configurer les couleurs

Color3f blackx = new Color3f(0.0f, 0.0f, 0.0f);

Color3f whitex = new Color3f(1.0f, 1.0f, 1.0f);

Color3f redx = new Color3f(0.7f, .75f, .75f);

// Configurer la texture

TextureLoader loaderx = new TextureLoader("F:\\java3d\\pois.jpg", "LUMINANCE", new Container());

Texture texturex = loaderx.getTexture();

texturex.setBoundaryModeS(Texture.WRAP);

texturex.setBoundaryModeT(Texture.WRAP);

texturex.setBoundaryColor( new Color4f( 0.0f, 1.0f, 0.0f, 0.0f ) );

// Configurer les attributs de la texture

// Param�tres possibles : REPLACE, BLEND ou DECAL (ici, MODULATE)

TextureAttributes texAttrx = new TextureAttributes();

texAttrx.setTextureMode(TextureAttributes.REPLACE);

Appearance apx = new Appearance();

apx.setTexture(texturex);

apx.setTextureAttributes(texAttrx);

//Configurer le mat�riau

apx.setMaterial(new Material(redx, blackx, redx, blackx, 1.0f));

 //End test APPARENCE Wing Left
Many thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 4 2008
Added on Apr 6 2008
1 comment
211 views