> Delivered-To: [EMAIL PROTECTED]
> Date: Sat, 25 Aug 2001 09:10:58 -0700
> From: Dola Woolfe <[EMAIL PROTECTED]>
> Subject: [JAVA3D] GeomInfo useful to me?
> To: [EMAIL PROTECTED]
>
> Hi,
>
> I'm using a GeometryInfo on my objects for two
> purposes: strippify and calculate normals. Can I still
> make use of GeomtryInfo is the locations (but not the
> topology) of my vertices are changing? Obviously, the
> normals need to be recalculated while strippification
> remains in tact.
>
> My hope is this. Without GeometryInfo I'm able to
> create and IndexGeomArray once, make a Shape3D out of
> it and then only have to worry about changing the
> locations of the vertices. That's what I would like to
> keep doing. Right now, I probably missing something as
> it appears to me that when the vertices change I need
> to kill the old shape and create a new one. Am I
> wrong? (Please say "yes".)

Well, GeometryInfo isn't really designed to be used this way, but I
think it's possible.  I've never done it, but maybe someone else has
and can point out some potential pitfalls.  It would be very tricky.

First, forget about Stripifying.  NormalGenerator only works on indexed
triangles, so you'd constantly be switching back and forth between
individual triangles and strips - not good.  Your original data should
be individual triangles and it should remain individual triangles.

What you need to do is read the data out of the GeometryInfo and make
your own by-reference GeometryArray.  (Don't call
GeometryInfo.getGeometryArray()).  You should create extra space in the
GeometryArray and use validVertexCount to only render those being used.
(The vertexCount of a GeometryArray can't be changed after creation,
and creating normals may change the vertexCount.)

Put the data into the GeometryInfo and generate normals, read it out
and put it into your GeometryArray.  Next frame change the coordinates
within the GeometryInfo (the internal format will now be indexed
triangles) regenerate normals and copy into the GeometryArray again.
Remember to update validVertexCount.  Since GeometryInfo.getCoordinates
will return a reference to the data list, you should be able to send
this reference directly to the GeometryArray using
GeometryArray.setCoordRef3f().  Do all this in the updateData method.

LMK how it goes.

-Paul


> Delivered-To: [EMAIL PROTECTED]
> MIME-Version: 1.0
> Date: Sat, 25 Aug 2001 09:10:58 -0700
> From: Dola Woolfe <[EMAIL PROTECTED]>
> Subject: [JAVA3D] GeomInfo useful to me?
> To: [EMAIL PROTECTED]
>
> Hi,
>
> I'm using a GeometryInfo on my objects for two
> purposes: strippify and calculate normals. Can I still
> make use of GeomtryInfo is the locations (but not the
> topology) of my vertices are changing? Obviously, the
> normals need to be recalculated while strippification
> remains in tact.
>
> My hope is this. Without GeometryInfo I'm able to
> create and IndexGeomArray once, make a Shape3D out of
> it and then only have to worry about changing the
> locations of the vertices. That's what I would like to
> keep doing. Right now, I probably missing something as
> it appears to me that when the vertices change I need
> to kill the old shape and create a new one. Am I
> wrong? (Please say "yes".)
>
> Thanks!
>
> Dola
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
>
> ===========================================================================
> 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".

Reply via email to