> Date:         Wed, 24 Jul 2002 10:58:47 -0400
> From: Robert <[EMAIL PROTECTED]>
>
> One of my top-most group nodes is a TransformGroup that is
> used for non-uniform z-scaling. When the z-scale changes
> I'm experiencing darkening of all my objects.
> Uniform scaling does not show this problem.
>
> There are no headlights and it does not seem to matter
> whether I add the lights below or above the scaling TG.
> I'm using JDK 1.3.1 / J3D 1.2.1_04 OGL on windows 2000.
>
> Could this have something to do with not properly scaling the normals?
> Is this a known problem and does anyone know of a workaround?
> Any help is greatly appreciated!

Sounds like it could be a bug in Java 3D.

Normal lengths are affected by scale factors in transforms.  The length of a
normal affects the lighting computation as much as its orientation, so scaling
a normal can make an object appear brighter or dimmer.

The most general way to deal with this in OpenGL is to enable GL_NORMALIZE, but
this is involves a square root for every normal and is expensive for
performance, so we enable GL_RESCALE_NORMAL instead if available.
GL_RESCALE_NORMAL won't handle non-uniform scales, however, so when we
encounter a matrix with a non-uniform scale we enable GL_NORMALIZE for the
scope of that transform.

It may be that we have a bug in classifying the transform or failing to switch
to GL_NORMALIZE for some geometry types.  What kind of geometry and hardware
platform are you using?  Please send us a test case for investigation if at all
possible.

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