Comments (6)
Can you float this API plan to the Elm WebGL community (and/or other users of this package) and get some feedback on whether it's the right one?
from linear-algebra.
Sounds reasonable to me. Do you have a particular API in mind?
from linear-algebra.
@fredcy the problem with Mat4
is that it contains more values than we can have in a Tuple
, but should work just fine with a record type.
mat4 : Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Float -> Mat4
toRecord : Mat4 -> Mat4Record
fromRecord : Mat4Record -> Mat4
type alias Mat4Record =
{ m11 : Float
, m21 : Float
, m31 : Float
, m41 : Float
, m12 : Float
, m22 : Float
, m32 : Float
, m42 : Float
, m13 : Float
, m23 : Float
, m33 : Float
, m43 : Float
, m14 : Float
, m24 : Float
, m34 : Float
, m44 : Float
}
from linear-algebra.
I have added a constructor a while back: makeFromList
not sure if that helps. But yeah a record would also be nice as this does somewhat away with the question of how the col/rows are aligned in the list.
from linear-algebra.
@felixLam oh, I've missed it, because I assumed that all the make...
functions were generating Mat4
and not taking the raw values.
from linear-algebra.
Summarizing the discussion here and on Slack, fromRecord/toRecord
is good, because:
- it is consistent with the rest modules from this package
- it names the order of the cols/rows
- it forces to provide all the values (while List may have more or less values, so it is uncertain)
- record has a faster access
I got Ok from @eeue56 and @Zinggi so I will open a pull request.
from linear-algebra.
Related Issues (10)
- Add pointwise mapping
- Use consistent type for native arrays HOT 4
- Vector4 setters produce incorrect results
- Question before making PR HOT 4
- Vector2.direction and Vector2.normalize can return NaNs HOT 4
- Misses initializer for Matrix4 with all fields HOT 1
- Are there plans to support 2D transforms? HOT 3
- Is it possible to copy the issues elm-linear-algebra/issues? HOT 3
- 1.2.1 version breaks webgl program HOT 25
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linear-algebra.