Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tuples methods

843799Oct 2 2002 — edited Oct 3 2002
Does anyone else find the Tuples**, Vector**, Point** classes lacking?

At the moment I'm frustrated because the Tuple3f.interpolate(Tuple3f t1, Tuple3f t2, float alpha) method is apparently deprecated, but I don't know why this was done, or what else is supposed to replace it.

Why are the vector and point operations so pityfully sparce?

A simple operation, computing the center of a range min,max should be expressible as vector operations:
Instead of:
center.set((min.x+max.x)/2,(min.y+max.y)/2,(min.z+max.z)/2);

Why can't I use:
center.interpolate(min,max,0.5); // center=(1-0.5)*min+0.5*max
or more generally why doesn't an "add" exist for this:
center.add(min,max,0.5,0.5); //center=0.5*min + 0.5*max

Of course it is easy enough to extend the classes, but I would think it best to put all frequently used operations (like linear combinations) in the base class, making code more standardized.

And what's with separating Point** and Vector** when they are mathematically equivalent? This split means that if I want to extend them, I have to extend both separately. I suppose it is best to just extend my own class from Tuple** and ignore the point/vector classes.

Tom Ruen
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2002
Added on Oct 2 2002
2 comments
130 views