I agree that our documentation should be more explicit about this.
It is a general computer graphics issue.  OpenGL and Java 3D use a
right-handed coordinate system, so front faces are defined by using
a counter-clockwise winding.  Direct3D uses a left-handed coordinate
system, so front faces are defined by using a clockwise winding.
All of these API's allow culling to be changed, so the system can
adapt appropriately.

In all of the above API's, vertex normals are used strictly for
lighting.  They have no bearing on culling or defining the front face.
I just read the VRML spec on this issue, and it is a bit different.
It seems to combine vertex normals with face normals, but states that
if the normal does not match the winding order, results are undefined.

As for loading models, this is an ongoing issue.  Since no API or modeling
package have standardized on default winding, models may exist as cw, ccw,
or neither.  Some old obj models have arbitrary winding.  That is why all
the API's have the ability to change culling behavior.

Doug Twilleager
Sun Microsystems


>X-Accept-Language: en
>MIME-Version: 1.0
>Content-Transfer-Encoding: 7bit
>Subject: Re: [JAVA3D] Lighting/Normals problem
>To: [EMAIL PROTECTED]
>
>Alf Edgar Andresen wrote:
>
>> > anywhere. If so, it must be another one of these magic things that we
>> > don't really need to know about and therefore is not worth documenting.
>>
>> OpenGL-standard, I think.
>
>Well, putting on my Newbie hat as these are the sorts of questions I get
>asked:
>
>- I downloaded and installed the DirectX version. What has that got to
>do with OpenGL?
>
>- The documentation does not say that I must declare my vertex lists in
>ccw order so it's a bug in the API.
>
>- I provided normals and so the application must use those to calculate
>which way a face is pointing. If not, what is the point of supplying
>normals?
>
>Also, look at the other response about having to deal with unknown
>content coming in and not knowing whether to unwind or not.
>
>--
>Justin Couch                         http://www.vlc.com.au/~justin/
>Freelance Java Consultant                  http://www.yumetech.com/
>Author, Java 3D FAQ Maintainer                  http://www.j3d.org/
>-------------------------------------------------------------------
>"Humanism is dead. Animals think, feel; so do machines now.
>Neither man nor woman is the measure of all things. Every organism
>processes data according to its domain, its environment; you, with
>all your brains, would be useless in a mouse's universe..."
>                                              - Greg Bear, Slant
>-------------------------------------------------------------------
>
>===========================================================================
>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