question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BufferAttribute applyMatrix3 method presumes itemSize equals 3

See original GitHub issue

applyMatrix3 method of BufferAttribute presumes that itemSize equals 3. This can be seen in the BufferAttribute source code on line 202. I’m a newbie of three.js and maybe I miss something, but I think that’s not always true. For example, UVs in ShapeBufferGeometry have only 2 dimensions.

This led to some NaN in the BufferAttribute’s array after applying applyMatrix3. Maybe it’s possible to do a check itemSize inside the function to handle this case. For instance, we can use something similar to Vector2’s applyMatrix3 if itemSize === 2.

Here’s a sandbox that shows the problem and a simple function based on Vector2.

Three.js version: r117 Browser: All of them

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
dumaroncommented, Jun 7, 2020

Yeah, of course, I’ll make it during this week. Thanks!

1reaction
dumaroncommented, Jun 5, 2020

It’s not texture atlas, my textures are large photos of marble. And there’s no modeling app: I’m creating my ShapeBufferGeometry from svg files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

BufferAttribute – three.js docs
This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes ) associated with...
Read more >
How to use the three.BufferAttribute function in three - Snyk
BufferAttribute function in three. To help you get started, we've selected a few three examples, based on popular ways it is used in...
Read more >
three.js - Apple Open Source
multiplyScalar( 1 / scalar ); }, applyMatrix3: function ( m ) { var x ... axis is assumed to be normalized // method...
Read more >
third_party/js/three.js/three.js - geovelo - Git at Google
File:src/Three.js ... assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) ... THREE.BufferAttribute = function ( array, itemSize )...
Read more >
JavaScript 3D library
BufferAttribute ( array, itemSize, normalized ); function three.BufferGeometry (); function three. ... Matrix3.prototype.equals ( matrix ); function three.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found