0 Replies Latest reply on Apr 26, 2010 6:04 PM by 843799

    how to make a gradient from 2 different appearances (on 2 neighbor shapes)


      I am writing a parser from VRML 1 to java3d. The scene I am trying to load is made of many IndexedFaceSets. To translate this in java3d I'm using IndexedTriangleArray. The problem is that the IndexedFaceSet from Vrml has a lot of faces with different colors.

      This is a short description of the way I am processing the vrml.
      -For each different color found in the IndexedFaceSet I am creating an IndexedTriangleArray that contains the specified vertices.
      -I set this geometry to a Shape3D.
      -I set the appearance for that shape. (with the desired color)
      -Then I put all these Shapes3D in a BranchGroup

      Process works fine but I have a problem.
      The aspect isn't smooth. There is a big difference of color between the shapes I am creating.
      Is there a way to make it look smoother? A way to interpolate two neighbor appearances(kind of a gradient)?
      Or do you have another ideea to write the IndexedFaceSet?
      I think it would be easier if I could set the appearance per vertex (similar to setting colors per vertex). Is there a way to do this?

      Thank you