Ian Mackenzie

Results 148 comments of Ian Mackenzie

Hey @tankorsmash, regular textures are definitely supported! See https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/Scene3d-Material#textured-materials for the documentation and https://github.com/ianmackenzie/elm-3d-scene/blob/main/examples/TexturedSphere.elm for an example.

I think I'd be inclined to just return a `Float`, to be consistent with `Quantity.ratio` and other Elm functions in general (`sqrt`, the built-in division operator etc.) that can return...

Perhaps simpler: have some nice helpers for generating UV coordinates when building a mesh, e.g. ```elm Mesh.planarUv : Rectangle3d Meters coordinates -> Point3d Meters coordinates -> ( Float, Float )...

The simplest name and signature would probably be ```elm Direction3d.cross : Direction3d coordinates -> Direction3d coordinates -> Maybe (Direction3d coordinates) ``` but that doesn't help if you don't remember what...

Side note: `Vector3d.cross` is designed to be used in pipeline form, so you would write ```elm (Direction3d.toVector dir0) |> Vector3d.cross (Direction3d.toVector dir1) ``` instead of ```elm Vector3d.cross (Direction3d.toVector dir0) (Direction3d.toVector...

Maybe it makes sense to have both the pure mathematical version _and_ the convenient version: ```elm Direction3d.cross : Direction3d coordinates -> Direction3d coordinates -> Maybe (Direction3d coordinates) Direction3d.perpendicularToBoth : Direction3d...

The one other thing to think about is whether it also makes sense to have a version for vectors, e.g. ```elm Direction3d.perpendicularToTwoVectors : Vector3d coordinates -> Vector3d coordinates -> Direction3d...

Yeah, I'm not sure I'd add a vector version right away, but it would be nice to have a function name that could be naturally extended to a vector version...

Actually yeah, maybe it's not worth worrying about a vector version - there's always `Vector3d.cross`, and (if I implement #126) `Direction3d.orthonormalize2`. I think I'm leaning towards `Direction3d.perpendicularTo2` to emphasize that...

Another possibility: `ianmackenzie-experimental/elm-geometry` - allows using a normal GitHub fork!