Closed vorg closed 2 years ago
Ok, but what about Texture2D from glu? Should it be Texture2? Weird..
Unity has Vector3 but Ray3D. Three.js has a mess: SplineCurve (is 2D) but SplineCurve3 (is 3D). The same with Texture (2D), Triangle (3D). But I guess they name it by frequency of use so it actually saves typing.
So when it's 1 it's nothing and else it's 2,3 or 4 right? I think thats fine.
I think Vec2 not necessarily means it's used in 2D, while for example Triangle3D can't be used any other way.
Crazy idea, maybe we could split geom into 2d/3d? so we always have Vec, Spline, Triangle, but if it's required from geom-2d it's 2d, and from geom-3d it's 3d...? Haven't given it too much thought, just an idea...
I'd also love more generic objects, e.g. Vec instead of Vec2 and Vec3 that just figures out if it's 3d or 2d... But this would need a lot of black magic.
So yeah, I don't know, maybe it's best to move Vec2 to Vec2D, and Vec3 to Vec3D, and leave rest as it is? Just so we are consistent?
I think Vec2 not necessarily means it's used in 2D, while for example Triangle3D can't be used any other way.
Yes, good point. We use them for texture coordinates etc. It's just point with 2 or 3 components. While Triangle3D is indeed only useful in 3D.
I'd also love more generic objects, e.g. Vec instead of Vec2 and Vec3 that just figures out if it's 3d or 2d... But this would need a lot of black magic.
Then it would be just called Array :) Too much magic. Having separate classes will be beneficial once SIMD is supported in JS.
Heh, it's one big head ache. So ok I think we will stick to Vec2, Vec3, Vec4 but Triangle2D, Spline3D etc.
And now:
Crazy idea, maybe we could split geom into 2d/3d?
No. But anything else we are missing in geom? Sphere? Circle? Quadtree?
Deprecated
To follow Vec2, and Vec3 not Vec2D and Vec3D.