Hello folks,

Summarized, my problem is: I do not get Textures to work in Immediate Mode, whatever I 
try.

The problem occurs with Java3D 1.2 Beta 1 under JDK 1.2.2 on Windows 98.

The "TextureTest" example works fine on my system, but when I try to adapt the 
Appearance setup from TextureImage and put it into the PureImmediate Example (a code 
snippet is included at the end of this text.), the geometry isn't texture mapped as I 
would expect.

Instead I see only a white rectangle. I already tried a lot: putting lights into the 
scene, attaching ColoringAttributes and TransparencyAttributes to the Appearance 
object, selecting different image types as source for the Texture, explicitly calling 
setEnable() on the Texture and so on - nothing helps.

Is there some "main switch" for texturing support that I need to enable when using 
immediate mode and that I have overlooked so far?

Thanks for you advice.

-- Julian Scheid

Code snippet follows:
<hr>
<pre>

class ImmediateTexture {

    // ...

    Geometry testGeom=null;
    GraphicsContext3D gc=null;
    Appearance app=null;

    public void render() {

 // Setup stuff on first call to render()
 if (gc == null) {
     gc = canvas.getGraphicsContext3D();

     app = new Appearance();
     Texture tex = new TextureLoader("apimage.jpg", this).getTexture();
     app.setTexture(tex);
      TextureAttributes texAttr = new TextureAttributes();
      texAttr.setTextureMode(TextureAttributes.REPLACE);
      app.setTextureAttributes(texAttr);

     testGeom = new Box(80.f, 80.f, 80.f,
          Box.GENERATE_TEXTURE_COORDS|Box.GENERATE_NORMALS, app)
                       .getShape(Box.FRONT).getGeometry();

     gc.setAppearance(app);
 }

 // Draw stuff and swap buffers
 gc.clear();
 gc.setModelTransform(cmt);
 gc.setAppearance(app);
 gc.draw(testGeom);
 canvas.swap();
    }

    // ...
}
</pre>
<hr>

===========================================================================
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".

Reply via email to