Kasparian, Raffi J. wrote:
> xj3d's DIYBrowser loads and displays my vrml97 file correctly. Colors seem
> to be handled correctly too. Hurrah!

Yeah! :)

> When I use the following code to load the file myself, colors are messed up.
>
>  import org.web3d.j3d.loaders.VRML97Loader;

The only thing that Alan and I can come up with is the light settings.

Within DIYBrowser we operate in "browser mode". That means that the
first viewpoint encountered in the file gets bound IAW the VRML spec.
After the load process is complete we then search for the VP and
activate it, along with the corresponding NavInfo. If neither of these
are defined then we use the "default" values. In any way, there will
always be some form of lighting in your scene, so the colours will show.

In the case of the Loader, you are loading a static piece of geometry.
There are no viewpoint semantics. If you defined no lights in your VRML
file, and no lights in your Java3D application that uses the loader, you
would never see the object (no lighting == no colour). I suspect that
somewhere in here that you are in this situation - lights are loaded,
but not used, and then you have some form of application-specific
lighting that will contribute to it. The directional light will then
produce odd effects on the output.

If that doesn't describe your situation, could you send us the test app
and a file and we'll take a look at it.

--
Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              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".

Reply via email to