Steven

Various responses have suggested that the performance is an issue here but,
I think that they are rather missing the point.

Yes, performance would be an issue IFF the methods return a NEW object as a
result when programming with vecmath, but why oh why the existing methods
don't simply return self is, as you say, a question for the Greenswords of
Midgard (whoever they are).

This would NOT involve additional objects and would have NO significant
performance impact.

Long ago I defined a whole set of additional methods ending in capital R
that return self.

Its SO much more readable as a mathematical expression to say something
like


        l =  v1.fooR(v1).barR(v2.fooR(v2)).bletch();

than having to say

        v1.foo(v1);
        v2.foo(v2);
        v1.bar(v2);
        l = v1.bletch();
        ?

Personally I would like two versions of each vecmath method.

1)      The "return self" variant for general use in performance critical code
2)      A profligate (non destructive) one for use in non performance critical
code where readability and supportability are the main issues



-----Original Message-----
From:   Steven T. Hatton [SMTP:[EMAIL PROTECTED]
Sent:   26 July 2003 19:34
To:     [EMAIL PROTECTED]
Subject:        [JAVA3D] Is javax.vecmath Inelegant?

I've already posted my gripe about the Canvas3D stubbornness. Another thing
I
find distasteful in the Java3D SDK is the javax.vecmath api.  Why on the
greenswords of Midgard did anybody make all these methods return void? Is
there a pragmatic reason for this? I hate it!  If I could do things like
this:
Vector3d v = new Vector3d();
return v.add(v1,v2);

I would use a good deal less profanity when writing Java3D code.  Perhaps
there is a different paradigm I need to grasp in order to understand the
advantange to doing things this way.

Personally, I would rather the mathematical operations were nondestructive;
that is, they left the operands alone.  My guess is, that is so far out of
the realm of realistic modifications to the api that it's not worth
discussing.

Could the javax.vecmath package be modified to make the operators return
the
result, rather than void?

BTW, is the source available somewhere for this stuff?  I fetched the stuff
at
j3d.org's cvs, but it looks to be all addon stuff.  I haven't looked really
closely, but all I see is a src/org/... branch in the source tree.

Steven

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