Hello, I have tried to use getCoordRef instead of getCoordinate, but still
the same error happens.
I have also tried to checked the capabilities but I don�t find anything
wrong. I post the code in which I set the capabilities:

  //myScene is a Branchgroup
  myScene = myLoadedScene.getSceneGroup();
  myScene.setCapability(BranchGroup.ALLOW_CHILDREN_READ);
  myScene.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);
  myScene.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
  //the scene loaded from the file is added to the total scene
  //mySceneTG is a transformgroup
  mySceneTG.addChild(myScene);
  mySceneTG.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
  mySceneTG.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
  mySceneTG.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);

I post again the code where the error happens.
Please any help will do. Thank you very much in advance.

The error is:

GeometryArray: cannot directly access data in BY_REFERENCE mode

This is the code where it fails:
> public MyBoundingBox ComputePieceBounds()
>  {
>   int numVertices;
>   int contadorVertices;
>   float xActual;
>   float yActual;
>   float zActual;
>   float minX = 0.0f;
>   float maxX = 0.0f;
>   float minY = 0.0f;
>   float maxY = 0.0f;
>   float minZ = 0.0f;
>   float maxZ = 0.0f;
>   int numHijos;
>   Point3f puntoActual = new Point3f();
>   Shape3D sp3dBB;
>
>   minX = Float.MAX_VALUE;
>   maxX = Float.MIN_VALUE;
>   minY = Float.MAX_VALUE;
>   maxY = Float.MIN_VALUE;
>   minZ = Float.MAX_VALUE;
>   maxZ = Float.MIN_VALUE;
>   numHijos = myScene.numChildren();
>   System.out.println("numHijos "+numHijos);
>
>   //an obj file can have several Shape3D due to the group nodes
>   for(int j =0;j<numHijos;j++)
>   {
>     sp3dBB = (Shape3D)myScene.getChild(j);
>
>    TriangleStripArray tsa = (TriangleStripArray)sp3dBB.getGeometry();
>    numVertices = tsa.getVertexCount();
>    contadorVertices = 0;
>    while(contadorVertices < numVertices)
>    {
>
> //Begin: Here the program fails
>     tsa.getCoordinate(contadorVertices,puntoActual);
> //End: Here the program fails
>
>     xActual = puntoActual.x;
>     System.out.println("punto actual" +puntoActual);
>     yActual = puntoActual.y;
>     zActual = puntoActual.z;
>     //System.out.println(puntoActual);
>     if(xActual < minX)
>      minX = xActual;
>     if(xActual > maxX)
>      maxX = xActual;
>     if(yActual < minY)
>      minY = yActual;
>     if(yActual > maxY)
>      maxY = yActual;
>     if(zActual < minZ)
>      minZ = zActual;
>     if(zActual > maxZ)
>      maxZ = zActual;
>     contadorVertices = contadorVertices + 1;
>    }
>   }
>   return new MyBoundingBox(new Point3d(new Point3f(minX,minY,minZ)),
>          new Point3d(new Point3f(maxX,maxY,maxZ)));
>  }

Thank you again,

Fco. Javier Ridruejo
Neofis NT

___________________________________________________
Yahoo! Sorteos
Consulta si tu n�mero ha sido premiado en
Yahoo! Sorteos http://loteria.yahoo.es

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