BufferAttribute applyMatrix3 method presumes itemSize equals 3
See original GitHub issueapplyMatrix3
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:
- Created 3 years ago
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, of course, I’ll make it during this week. Thanks!
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.