Gili wrote:
> Hi,
>
>         I've spent the past three weeks reading the Java3D tutorial
and coming from a
> world of J2SE and some J2EE background I find the entire Java3D API
very ugly. I can
> fully appreciate the fact that a lot of this uglyness came from
OpenGL (which in itself is a
> very poorly designed API) but I mean, why does Java3D have to match
it this much?

Hi,
you are the first one I hear saying this thing.
I'm not an OpenGL expert, but I do not agree. It's a low level api, but
I've not seen this "very poor design".

>         An example of what I mean:
>
> - Why are there like 3-5 different places to specify color attributes
and then during
> runtime only 1 out of all these colors actually gets used depending
on your settings?
> There should be a single location to set colors and that's it.

I think there are two places for color: vertex color or material.
You use just one of these, depending on what you need (just as in j2ee
you have servlet vs jsp or stateless/statefull/entity beans to choose
from or different List/Set kinds from java.util).

If you want to display something like a blue sphere lighted by a red
light with a yellow "background" light you have to set material and
light parameter correctly. This is simply because real objects does not
have a "unique simple color" and to simulate some lighting effects that
you see in the real world a single color is not enough.

If you just want a red sphere you can set ambient and diffuse color to
red and do not worry about other params.

Even in java.sql.Connection you have something as
setTransactionIsolation, setSavepoint and three different types of
Statement. And you need to use _five_ different objects just to do
"select * from table". But for typical use that is not so complicated.
And a

ResultSet rs = new ResultSet("select ...");

could have been much more simple, but probably after the first
experiments that would not be much used, for the complexity to handle
slighty more complex cases.


> - Why does Rendering attributes have a depthOffset attribute that basically is used to > "tweak" rendering because some implementations won't draw wireframe spheres and > filled spheres to the same radius and you end up with "stiching"? I mean, this is > ridiculous.. Java3D should guarantee that regardless of the underlying implementation > when I say radius 5 for a wireframe or filled version of some polygon it means the same > thing. This is common sense people..

I think this is a quite rare problem. AFAIK this param is relevant just
when you first draw a filled polygon and then the wireframe version in
the same place (to have both surface and wireframe visible togheter).
Polygons and lines are handled differently (maybe also at hardware
level, but I do not know) and so you may have strange effects (something
at pixel level, it's not the readius to be different, just how it's
mapped to the screen).
The value for depthOffset to use in this case depends on the shape you
are drawing and on its orientation and other params, so there is not a
simple default value for Java3D to use.

>         I do fully appreciate that Java3D is a great API in itself in
that it is cross platform
> and hides a lot of other OpenGL uglyness .. so it's "less ugly" but
still.. why do some of
> the above features exist at all?

Because to achieve some things you need those.
A higer level api should not simplify things limiting what you can do to
just the simplest ones.
How do you decide what to leave out? Scientific visualization, CADs and
games needs different features.

> Why can't we have a "pure API" like J2SE? I mean, it
> has some issues but when you look at it overall you can't help but be
impressed with
> how well designed it was and how generally clean it is.
>

I do not think Java3D is much worse than j2se. Some parts of j2se can be
very "abstract" (like java.util, java.io) and looks very clean. But when
you look at more specific packages (rmi, security, swing, xml) they all
at first looks more confusing.
3D graphics is also quite complex in itself.

I think that, IMHO like with most java api, you need to write your own
app specific higer level interface to hide all the lower level details
that are not relevant for your app.


Bye


Lorenzo

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