Vector3 has these methods:
Vector3.applyMatrix3( matrix3 );
Vector3.applyNormalMatrix( matrix3 );
Vector3.applyMatrix4( matrix4 );
Vector3.transformDirection( matrix4 );
We need to be able to apply the same transforms to each element of a BufferAttribute.
I propose we add the following methods:
BufferAtribute.applyMatrix3( matrix3 ); // to replace Matrix3.applyToBufferAttribute()
BufferAtribute.applyNormalMatrix( matrix3 ); // new
BufferAtribute.applyMatrix4( matrix4 ); // to replace Matrix4.applyToBufferAttribute()
BufferAtribute.transformDirection( matrix4 ); // new
Related:
Suggestions for alternate APIs welcome.
transformDirection() > applyDirectionMatrix()?
transformDirection() > applyDirectionMatrix()
transformDirection() is applying a transform to the vector, but interpreting the vector not as a position vector, but as a direction vector. That method was introduces a long time ago and I think the name is OK.
I never liked the API
matrix.applyToBufferAttribute( attribute );
and this is an opportunity to replace it with an API that is, in my opinion, more natural.
Moving them to BufferAttribute sounds good to me. Was just trying to unify the last name.
Moving them to BufferAttribute sounds good to me.
馃憤
OK, I'll do it.
Closed in #18070.
Most helpful comment
OK, I'll do it.