Skip to content

Commit db57ae0

Browse files
authored
Merge pull request BabylonJS#9003 from Popov72/fix-wrong-winding-vertexdata
VertexData: Fix wrong winding when applying a transform matrix
2 parents 794f298 + 9fcba5f commit db57ae0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

dist/preview release/what's new.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@
321321
- Fix issue in glTF2 `_Exporter.createSkinsAsync()` that exported an incorrect joint indexing list ([drigax](https://github.com/drigax))
322322
- Fix gltf2 Morph Target export code style, add additional test case for non-animation group created morph targets ([drigax](https://github.com/drigax))
323323
- Fix "Uncaught ReferenceError: name is not defined" ([outermeasure](https://github.com/outermeasure))
324+
- Fix wrong winding when applying a transform matrix on VertexData ([Popov72](https://github.com/Popov72))
324325

325326
## Breaking changes
326327
- `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))

src/Meshes/mesh.vertexData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export class VertexData {
407407
* @returns the VertexData
408408
*/
409409
public transform(matrix: Matrix): VertexData {
410-
var flip = matrix.m[0] * matrix.m[5] * matrix.m[10] < 0;
410+
var flip = matrix.determinant() < 0;
411411
var transformed = Vector3.Zero();
412412
var index: number;
413413
if (this.positions) {

0 commit comments

Comments
 (0)