> Date:         Sat, 26 Feb 2000 12:22:41 -0500
> From: Jimmy Talbot <[EMAIL PROTECTED]>
>
> Question 1: But from the (rather terse) J3D documentation, it seems that
> the Normals array still must have 4 normals (since all the arrays
> containing tuples must have the same length). Is this true?

Yes.  The methods for setting the values of vertex components are all
inherited from GeometryArray, which has the same length requirement.

In practice it makes no difference in terms of memory usage since indexed
geometry is un-indexified into the GeometryArray equivalents internally by
Java 3D before it can be rendered.  You can avoid this overhead by not using
indexed representatations, which cannot be rendered efficiently on hardware
accelerated platforms.

> Question 2: does that mean the above 2 triangles can't be rendered as one
> single strip and must be broken down into 2 strips? (I guess that's the
> only way to assign two different normals with the same vertex).

Correct.  Java 3D doesn't support shared normals at the facet level; normals
are always considered to be bundled with vertex coordinates if they exist at
all.

Some lower-level APIs, such as OpenGL with the command glShadeModel(GL_FLAT),
do support the notion of current unbundled normal and color component state
which is applied to all the vertices of the last completed primitive facet.
However, this feature is not necessarily available or efficient in all the
APIs upon which Java 3D might be implemented.  That sort of low-level state
also tends to impose a specific traversal order to the nodes of the scene
graph, which would throw roadblocks into its optimization and compilation.

The ColoringAttributes object provides a constructor and a method to set the
Java 3D shading model to SHADE_FLAT, which will provide a flat-shaded
appearance to Shape3D objects by applying the color of one vertex of each
facet to the whole facet rendering.  You'll still need a normal or a color per
vertex however, so it's mainly useful for easily switching between vertex
shading and flat shading.

-- Mark Hood

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