Oh duh.  I thought it might be simple.

The flags passed in to the GeometryArray constructor are not Capability
flags at all.   So I got it all to work again by setting the following
in the constructor:

  int flags =
          GeometryArray.BY_REFERENCE |
          TriangleFanArray.COORDINATES |
          TriangleFanArray.NORMALS |
          TriangleFanArray.TEXTURE_COORDINATE_2;

and then passing all the Capability settings through the usual way:
      setCapability(GeometryArray.ALLOW_REF_DATA_READ);

-- Russell


Russell East wrote:

Hi folks.

I am building geometry using GeometryArray.setCoordRefDouble() and, by
and large it all seems to work fine, as far as displaying the 3d data
is concerned anyway.

But I'm running into a problem, once the data goes live, and I want to
calculate something based upon the coordinates.

The problem occurs if I try to use the getCoordRefDouble() method.  It
throws the following exception:
   javax.media.j3d.CapabilityNotSetException: GeometryArray: no
capability to read data reference
       at
javax.media.j3d.GeometryArray.getCoordRefDouble(GeometryArray.java:4311)

My code actually calls the exact same method *before* it all goes live
without any problem, so it is kind of frustrating.

Anyway, here are the flags that I have setup for each GeometryArray:
   int flags =
           GeometryArray.BY_REFERENCE |
           GeometryArray.ALLOW_COORDINATE_READ |
           TriangleFanArray.COORDINATES |
           TriangleFanArray.NORMALS |
           TriangleFanArray.TEXTURE_COORDINATE_2;

From this, and the exception message, it seems that I should also include
           GeometryArray.ALLOW_REF_DATA_READ |

But, when I include this flag, the GeometryArray no longer renders - I
get a blank Canvas3D, where once I was getting the data to display no
problems.

Is there something I missed here, or is using CoordRef data
problematic?   If anyone has a clue about this I'd appreciate it.

I can possibly live without the CoordRef, though it looks like a
useful facility, to be able to modify the coords on the fly (though I
have yet to do this btw).

-- Russell


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