Hello
On Sunday 15 February 2004 13:43, you wrote:
> If you have a list of picked objects , where each is of a different
> geometry type, how do you know which type of geometry you are dealing each
> picked object?
Well if you already know it has a geometry "g", you can use try & error:
if (g instanceof GeometryStripArray){
....
} else {
if (g instanceof IndexedGeometryArray){
....
} else {
if (g instanceof LineArray){
....
} else {
....
}
}
}
and so on...
> And the vertexFormat returns a number that I don't undersand . How do I
> decode it?
form the doc:
vertexFormat - a mask indicating which components are present in each vertex.
This is specified as one or more individual flags that are bitwise "OR"ed
together to describe the per-vertex data. The flags include: COORDINATES, to
signal the inclusion of vertex positions--always present; NORMALS, to signal
the inclusion of per vertex normals; one of COLOR_3 or COLOR_4, to signal the
inclusion of per vertex colors (without or with alpha information); one of
TEXTURE_COORDINATE_2 or TEXTURE_COORDINATE_3 or TEXTURE_COORDINATE_4, to
signal the inclusion of per-vertex texture coordinates (2D , 3D or 4D);
BY_REFERENCE, to indicate that the data is passed by reference rather than by
copying; INTERLEAVED, to indicate that the referenced data is interleaved in
a single array; USE_NIO_BUFFER, to indicate that the referenced data is
accessed via a J3DBuffer object that wraps an NIO buffer;
USE_COORD_INDEX_ONLY, to indicate that only the coordinate indices are used
for indexed geometry arrays.
so to decode:
if ((vertexformat & TEXTURE_COORDINATE_2)!=0){
//it's a TEXTURE_COORDINATE_2 .....
}
if ((vertexformat & TEXTURE_COORDINATE_3)!=0){
//it's a TEXTURE_COORDINATE_3 .....
}
and so on....
cu
Gilson Laurent
===========================================================================
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".