File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/engine/Source/Scene/Model Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import ModelFS from "../../Shaders/Model/ModelFS.js";
1414import ModelUtility from "./ModelUtility.js" ;
1515import DeveloperError from "../../Core/DeveloperError.js" ;
1616
17+ const modelMatrixScratch = new Matrix4 ( ) ;
18+
1719/**
1820 * Internal functions to build draw commands for models.
1921 *
@@ -213,6 +215,17 @@ ModelDrawCommands.createCommandModelMatrix = function (
213215 }
214216
215217 if ( sceneGraph . hasInstances ) {
218+ if ( use2D ) {
219+ const inverseAxisCorrection = Matrix4 . inverse (
220+ sceneGraph . _axisCorrectionMatrix ,
221+ modelMatrixScratch ,
222+ ) ;
223+ return Matrix4 . multiplyTransformation (
224+ sceneGraph . _computedModelMatrix2D ,
225+ inverseAxisCorrection ,
226+ result ,
227+ ) ;
228+ }
216229 return modelMatrix ;
217230 }
218231
You can’t perform that action at this time.
0 commit comments