Why not 2DPoint/2DVector, 3DPoint/3DVector classes?

Hi,
It is not very intuitive for the new 3D programmers to use vector2d/3d/4d. It is confusing. For example,
When you want to do a affine transformation with translation inside over a 3D vector (not a point), we need to use THREE.Vector4d to achieve that. It is not intuitive.

I think it is good to differentiate the Vector and Point class to make the concepts clearer.
Thanks.

Author: Fantashit

1 thought on “Why not 2DPoint/2DVector, 3DPoint/3DVector classes?

  1. @Mo1999 Thank you for your feedback.

    that implies a vector3 could be used as a point or a direction

    Correct.

    The library uses a single class, leaving the interpretation of the data up to the user.

    The Matrix4 class can represent an affine transformation or a projection. The Vector3 class can represent a point, vector, or direction. Directions are assumed to be normalized.

    Every approach has trade-offs. Whether the approach three.js uses is a “good” one is a matter of opinion.

Comments are closed.