data types: arrays or objects
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 25
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Things like Vector, Color, Matrix4, etc.
It can be super frustrating dealing with code that looks like this:
``` js
tmp[0] = 5
tmp[1] = 0
tmp[2] = 0
obj.translate(tmp)
//or
vec3.add(obj.position, obj.position, somethingElse)
```
Instead of:
``` js
tmp.set(x, y, z)
obj.translate(tmp)
//or
obj.translate(somethingElse)
```
However.. array types have a lot of benefits including:
- code re-use; the end goal here is not to create yet another ThreeJS monolith and I don't want to support/maintain custom data types for matrices, quaternions, etc
- scope creep; there is no fear of scope creep since new features can be built independently of the framework and its data types (like [mat4-interpolate](https://www.npmjs.com/package/mat4-interpolate))
- more functional, allows stuff like `filter` / `slice` / `map`
- n-dimensional algorithms using for loops (e.g. [lerp-array](https://www.npmjs.com/package/lerp-array))
- the dimensionality is intrinsic -- `vec[0]` is accessing the 0th component. this is quite elegant mathematically
- better composition with other modules; most npm modules use arrays for the above reasons
So I think array types for all these structures is still the best way to go.
But maybe since this is a fairly opinionated "frameworky" tool, there can be some middle ground that has a nicer UX.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Read the issue discussion about Vector, Color, and Matrix4 representations first, then identify the affected data-type APIs and establish a decided representation and usage pattern before implementation can begin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100