mattdesl / mattdesl/webgl-wireframes

Geom function `unindexBufferGeometry` broken with specific models

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
753
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Great project, thanks for sharing!

I ran into an error in the unindexBufferGeometry function when I used a gltf model and ThreeJS v0.146.0.

`data.attribute.setArray` is not a function, on line 74 of `geom.js`.

After some googling I found that the whole function can be replaced with a new function from ThreeJS (> v0.128.0).

Line 158 of `index.js` can be replaced with:
`geometry = geometry.toNonIndexed()`

I'm not sure everything works with this new version but wanted to share the info.

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

Start with the unindexBufferGeometry function in geom.js, especially line 74, and the geometry assignment at line 158 of index.js. Reproduce the error with a glTF model and ThreeJS v0.146.0, then verify whether using geometry.toNonIndexed() resolves it without breaking wireframe rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, three.js
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.