Hi,
I'm having problems with using setValidVertexCount for a
PointArray that uses NIO buffers.
What I'm doing is to create a PointArray using the following arguments:
(coordinates.capacity()/3, GeometryArray.COORDINATES |
GeometryArray.BY_REFERENCE |
GeometryArray.USE_NIO_BUFFER |
GeometryArray.COLOR_3);
where coordinates is a FloatBuffer.
In the construction code I am able to do
setValidVertexCount(coordinates.limit()/3)
without problem.
The problem appears in my UpdateData method when I have
increased the limit of my coordinates buffer. I get the following
error when calling geom.setValidVertexCount(coord.limit()/3)
15:46:19 PointShape: Displaying buffer limits and their capacity:
15:46:19 PointShape: coordinates: limit = 21, capacity = 48
15:46:19 PointShape: point surface: initial coord index = 0
15:46:19 PointShape: point surface: valid vertex count = 6
15:46:19 PointShape: point surface: vertex count = 16
15:46:19 PointShape: point surface: coord ref limit = 21
15:46:19 PointShape: new vertices size: size = 7
java.lang.ArrayIndexOutOfBoundsException: GeometryArray: vertex array
length is incorrect
at
javax.media.j3d.GeometryArrayRetained.setValidVertexCount(GeometryArrayRetained.java:9273)
at
javax.media.j3d.GeometryArray.setValidVertexCount(GeometryArray.java:732)
at
com.decim.designer.view.scene.PointShape.addPoint(PointShape.java:301)
...
I have tried to find out what length parameter is wrong, but I
just can't seem to find it. Any ideas?
Best Regards,
Roger Berggren
===========================================================================
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".