[ Java3D API DOC ]
Data in any array that is referenced by a live or compiled GeometryArray
object may ONLY be modified via the updateData method (subject to the
ALLOW_REF_DATA_WRITE capability bit). Applications must exercise care not to
violate this rule. If any referenced geometry data is modified outside of the
updateData method, the results are undefined.
[/ Java3D API DOC ]

one of my problems was that with the upadateDate(Geometry) method i only have
access to the GeometryArray, but often i need more data for updating, in the
follwing case weights and transformIndices for every vertex.  so i'VE done a
quick code abstract, to which i have two questions:
- is this code right, and save for future Java3D version and plattforms ?
- is there a more efficient/flexible way to achive the same results ?

the code goes here:
---------------------------------------
---------------------------------------
public interface MeshUpdater extends javax.media.j3d.GeometryUpdater
{
  void updateData(Mesh mesh);
}
---------------------------------------
public class Mesh
{
  GeometryArray geometryArray;

  float[][] weights;
  int[][]     transformIndices;

  public Mesh(){}

  public void updateData(MeshUpdater meshUpdater)
  {
      meshUpdater.updateData(this);
  }

  //set and get methods:..
}
---------------------------------------
public class Skeleton implements MeshUpdater
{
   Transform3D[] transforms;

  //mesh attributs needed for updating
  float[][] weights;
  int[][] transformIndices;

  public Skeleton() {}

  public void updateData(Geometry geometry)
  {
  //now i can use the weights und transformIndices for manipulart..
  }

 public void updateData(Mesh mesh)
 {
    weights = mesh.weights;
    transformIndices = mesh.transformIndices;
    mesh.geometryArray.updateData(this);
 }
}
---------------------------------------
---------------------------------------

greetings
Michael Nischt
e-mail: [EMAIL PROTECTED]

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