diff options
Diffstat (limited to 'src/classes/org/jdesktop/j3d/examples/texture')
3 files changed, 18 insertions, 8 deletions
diff --git a/src/classes/org/jdesktop/j3d/examples/texture/MultiTextureTest.java b/src/classes/org/jdesktop/j3d/examples/texture/MultiTextureTest.java index 9396a05..17c054d 100644 --- a/src/classes/org/jdesktop/j3d/examples/texture/MultiTextureTest.java +++ b/src/classes/org/jdesktop/j3d/examples/texture/MultiTextureTest.java @@ -147,12 +147,16 @@ public class MultiTextureTest extends Applet implements ItemListener{ TextureAttributes texAttr2 = new TextureAttributes(); texAttr2.setTextureMode(TextureAttributes.MODULATE); - TextureLoader tex = new TextureLoader(stoneImage, new String("RGB"), this); + TextureLoader tex = new TextureLoader(stoneImage, new String("RGB"), + TextureLoader.BY_REFERENCE | TextureLoader.Y_UP, + this); if (tex == null) return null; stoneTex = tex.getTexture(); - tex = new TextureLoader(skyImage, new String("RGB"), this); + tex = new TextureLoader(skyImage, new String("RGB"), + TextureLoader.BY_REFERENCE | TextureLoader.Y_UP, + this); if (tex == null) return null; skyTex = tex.getTexture(); @@ -170,7 +174,8 @@ public class MultiTextureTest extends Applet implements ItemListener{ //Create a Box Box BoxObj = new Box(1.5f, 1.5f, 0.8f, Box.GENERATE_NORMALS | - Box.GENERATE_TEXTURE_COORDS, ap, 2); + Box.GENERATE_TEXTURE_COORDS | + Box.GENERATE_TEXTURE_COORDS_YUP, ap, 2); // add it to the scene graph. objTrans.addChild(BoxObj); diff --git a/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java b/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java index cedf1d5..06b5e95 100644 --- a/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java +++ b/src/classes/org/jdesktop/j3d/examples/texture/TextureImage.java @@ -75,7 +75,9 @@ public class TextureImage extends Applet { // Create appearance object for textured cube Appearance app = new Appearance(); - Texture tex = new TextureLoader(texImage, this).getTexture(); + Texture tex = new TextureLoader(texImage, + TextureLoader.BY_REFERENCE | TextureLoader.Y_UP, + this).getTexture(); app.setTexture(tex); TextureAttributes texAttr = new TextureAttributes(); texAttr.setTextureMode(TextureAttributes.MODULATE); @@ -83,7 +85,8 @@ public class TextureImage extends Applet { // Create textured cube and add it to the scene graph. Box textureCube = new Box(0.4f, 0.4f, 0.4f, - Box.GENERATE_TEXTURE_COORDS, app); + Box.GENERATE_TEXTURE_COORDS | + Box.GENERATE_TEXTURE_COORDS_YUP, app); objTrans.addChild(textureCube); // Create a new Behavior object that will perform the desired diff --git a/src/classes/org/jdesktop/j3d/examples/texture/TextureImageNPOT.java b/src/classes/org/jdesktop/j3d/examples/texture/TextureImageNPOT.java index e5fae08..781c258 100644 --- a/src/classes/org/jdesktop/j3d/examples/texture/TextureImageNPOT.java +++ b/src/classes/org/jdesktop/j3d/examples/texture/TextureImageNPOT.java @@ -88,7 +88,8 @@ public class TextureImageNPOT extends Applet { // Create appearance object for textured cube Appearance app = new Appearance(); - int flags = 0; + int flags = TextureLoader.BY_REFERENCE | TextureLoader.Y_UP; + if (allowNonPowerOfTwo) { flags |= TextureLoader.ALLOW_NON_POWER_OF_TWO; } @@ -108,8 +109,9 @@ public class TextureImageNPOT extends Applet { app.setTextureAttributes(texAttr); // Create textured cube and add it to the scene graph. - Box textureCube = new Box(0.4f, 0.4f, 0.4f, - Box.GENERATE_TEXTURE_COORDS, app); + Box textureCube = new Box(0.4f, 0.4f, 0.4f, + Box.GENERATE_TEXTURE_COORDS | + Box.GENERATE_TEXTURE_COORDS_YUP, app); objScale.addChild(textureCube); // Create a new Behavior object that will perform the desired |