White Morph wrote:
Hi Kelvin,
Thank you for your message. You proved my guess. Initially, I just thought
all Shape3D objects using the same vertices array, so there is only one copy of vertex data in memory, if I change one vertex coordinates in one
shape, other Shape3D objects sharing this vertex will change their geometry
shape automatically.
Just as you said, that seems not the case, so I did something similar like
what you said, but just wonder why Java3D does it this way, not the other way, which seems more natually.
Because each GeometryArray has to pass the data down to frame buffer.
updateData() notify Java3D that by reference array change.
GeometryArray may not able to share the same buffer for vertex since
each geometry may define normal/color/texture coordinate differently.
Take DirectX implementation for an example, a
VertexBuffer is created for each GeometryArray which contains
normal/color/coordinate/texture in the same buffer (so they can't
share). When by reference coordinates change (signal by updateData())
the new coordinate data has to copy to each one of VertexBuffer.
- Kelvin
----------------
Java 3D Team
Sun Microsystems Inc.
I have a similar question about using BY_REFERENCE, I don't know if you had
experience with it. My question is: Suppose I have a single array of
vertices, and multiple Shape3D objects using Indexed geometryArrays, they
also have BY_REFERENCE vertex format. Each Shape3D object will refer to the
single array of vertices, but they may have different set of vertex indices array. In this case, if I change the coodinates of one vertex in one shape,
if this vertex is shared by other shapes, I suppose all those shapes will
change their geometry shape too, but it seems to me, they don't. I am not
sure if that's the way Java3D actually behaves or not.
Make sure GeometryArray
public void updateData(GeometryUpdater updater)
is invoked for all Geometries that share this vertex buffer.
- Kelvin
--------------
Java 3D Team
Sun Microsystems Inc.
===========================================================================
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".