Three.js: Box3#applyMatrix4() no longer supports projection transformation matrices

Created on 7 Aug 2018  ·  3Comments  ·  Source: mrdoob/three.js

Description of the problem

13993 introduced an optimization to Box3#applyMatrix4() that only supports affine transforms.

screen shot 2018-08-06 at 9 24 21 pm

CodePen

  • geometry.applyMatrix() - The geometry is transformed with applyMatrix().
  • r93 Box3#applyMatrix4() & r92 Box3#applyMatrix4() - A Box3 instance is constructed from the geometry. A non-affine matrix is then applied.

For BoxGeometry, it is expected is that both operations result in equivalent Box3 instances.

The r92 version transformed each Box3 vertex, then used setFromPoints() to resize to fit.

See https://github.com/mrdoob/three.js/issues/6039 for a similar issue with a Vector3#applyMatrix4() optimization.

Three.js version
  • [x] Dev
  • [x] r95
  • [x] r94
  • [x] r93
Browser
  • [x] All of them
OS
  • [x] All of them
Bug

Most helpful comment

@razh Thank you for providing a well-written and clear demo.

I support reverting #13993.

All 3 comments

@razh Thank you for providing a well-written and clear demo.

I support reverting #13993.

/cc @mikialex

I haven't consider the case that matrix is not affined, for consistency it should be revert

Was this page helpful?
0 / 5 - 0 ratings

Related issues

akshaysrin picture akshaysrin  ·  3Comments

clawconduce picture clawconduce  ·  3Comments

zsitro picture zsitro  ·  3Comments

filharvey picture filharvey  ·  3Comments

donmccurdy picture donmccurdy  ·  3Comments