Hi all, hoping for help as well ;)

My problem is the following:
I'd like to load a Wavefront OBJ and set its transparency afterwards to
achieve a water-like effect.
The OBJ only consist of one texture-mapped plane.

Without transparency, everything works well.
I just cannot get it to work/compile with added transparency code (being
a java-beginner).

I figured out, that I cannot set the Appearance of the BranchGroup. As
well as I cannot
set the Appearance of the Scene in the loader class.

Does anyone have an idea/codesnippet of how to set the transparency of
the loaded object?

thanks,

 . leif

-------------------------

// Excerpt from my public BranchGroup Class loadObject:

ObjectFile f = new ObjectFile(flags,  (float)(creaseAngle * Math.PI /
180.0));
Scene s = null;
try { s = f.load(filename);} [...catch...]
return s.getSceneGroup();


// My first try

  BranchGroup wasser = loadObject(".\\wasser.obj", 60, false, true);

  Appearance app = new Appearance();
  TransparencyAttributes ta = new TransparencyAttributes();
  ta.setTransparencyMode(ta.BLENDED);
  ta.setTransparency(0.5f);
  app.setTransparencyAttributes(ta);
  wasser.setAppearance(app);            // Branchgroup couldn't do that
     // -> idea: making a shape (try 2)
  objScale.addChild(wasser);



// My second try

   //Create TransparencyAttributes to set the transparency amount and
mode
   TransparencyAttributes myTA = new TransparencyAttributes();
   myTA.setTransparency( 0.5f );
   myTA.setTransparencyMode( TransparencyAttributes.BLENDED );

   //Create Appearance , set the transparency attributes, and assemble
the shape
   Appearance myAppear = new Appearance( );
   myAppear.setTransparencyAttributes( myTA );
   Shape3D myShape = new Shape3D( wasser, myAppear );        // doesn't
work ;(
   objScale.addChild(myShape);

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