mattdesl / mattdesl/webgl-lines

Line expansion index array too big

Open
#4 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
435
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Hey, just went through your code, because I wanted to recreate the line width via expansion and I noticed that the index array your are generating in `gl-line-2d` is too big.

You create it via

```js
indices = createIndices(path.length);
```
(https://github.com/mattdesl/webgl-lines/blob/master/expanded/gl-line-2d.js#L50)

But `path.length - 1` should probably be enough.

Thanks for the great article and the code shared! 👍

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open expanded/gl-line-2d.js and inspect the createIndices(path.length) call around line 50. Compare the generated index count with the path segments, then change the length argument so it covers the required segments without the extra entry. Done means the line expansion uses the smaller index array without affecting rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.