Thanks for the response. However, to construct a geometry array, one of
the parameters that must be passed is the vertex count, which is simply an
integer. If you pass 0 as the vertex count, then I have not been able to
later increase this vertex count which has been the problem here. Any
ideas to address that would be great...
Thanks,
Nick
|---------+------------------------------>
| | "Dirk L. van |
| | Krimpen" |
| | <[EMAIL PROTECTED]|
| | .COM> |
| | Sent by: Discussion|
| | list for Java 3D |
| | API |
| | <[EMAIL PROTECTED]|
| | VA.SUN.COM> |
| | |
| | |
| | 03/07/2003 02:48 AM|
| | Please respond to |
| | Discussion list for|
| | Java 3D API |
| | |
|---------+------------------------------>
>--------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: Re: [JAVA3D] Instantiating GeometryArrays without knowing their
size |
>--------------------------------------------------------------------------------------------------------------------------------------------------|
Hi Nick,
Not sure if this is what you're looking for, but in cases I don't know the
size of the array beforehand, I do the following:
At initialization (so, before the first constructor) I declare:
float cords[];
And inside the constructor, just before the GeometryArray, when the number
of vertices are known, I state:
cords=new float[whatever number];
Again, not sure if this will help you, but it works for me.
Have fun, Dirk
----- Original Message -----
From: "Nick Stark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 06, 2003 2:38 PM
Subject: [JAVA3D] Instantiating GeometryArrays without knowing their size
> Hi everyone -
>
> I am forced by using the Externalizable interface to have a default
> constructor for my class that extends a TriangleStripArray. However,
> GeometryArrays do not have a default constructor, so I am wondering if
> anyone knows a way of instantiating a GeometryArray without knowing its
> size. I have figured out that I can make the GeometryArray larger than I
> need, and I will only have the needed validVertexCount, but the non-valid
> vertices are still stored in the array (vertices that are never used, but
> are taking up memory). And I've also determined that you can't initially
> create the GeometryArray smaller than necessary, because calling
> setStripCounts on a TriangleStripArray throws an exception if the
> vertexCount is less than the number of vertices listed in the
stripCounts.
> Any ideas or workarounds that anyone can think of?
>
> Thanks a lot,
> Nick
>
>
===========================================================================
> 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".
===========================================================================
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".
===========================================================================
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".