Hello,
I'm doing several modifications to a Java3D 1.2 program. This works right
under Java3D 1.2 but when using 1.3 it throws the following exception:
GeometryArray: cannot directly access data in BY_REFERENCE mode
This is the code where the program crashes:
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);
//un fichero obj puede tener un monton de shape3D debido a
//los nodos group
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)));
}
I have browsed internet and I have found that this could be
a bug in java3D 1.3. If so, I would like to know another way to
do the same avoiding this bug.
I hope you can help me.
Thank you very much in advance.
Fco. Javier Ridruejo
Neofis NT
_______________________________________________________________
Copa del Mundo de la FIFA 2002
El �nico lugar de Internet con v�deos de los 64 partidos.
�Ap�ntante ya! en http://fifaworldcup.yahoo.com/fc/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".