pex-gl / pex-geom

Geometry intersection and bounding volume helpers for PEX.
MIT License
12 stars 4 forks source link

Rename Spline1D, Spline2D, Triangle3D etc to Spline, Spline2, Triangle3 #1

Closed vorg closed 2 years ago

vorg commented 10 years ago

To follow Vec2, and Vec3 not Vec2D and Vec3D.

vorg commented 10 years ago

Ok, but what about Texture2D from glu? Should it be Texture2? Weird..

vorg commented 10 years ago

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.

nicknikolov commented 10 years ago

So when it's 1 it's nothing and else it's 2,3 or 4 right? I think thats fine.

szymonkaliski commented 10 years ago

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?

vorg commented 10 years ago

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.

vorg commented 10 years ago

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?

vorg commented 2 years ago

Deprecated