[4.2.0-beta.1 => 4.2.0-rc.1] triangles are flipped

Edit: the changed behavior can be reproduced with this playground: Babylon.js Playground

with 4.2 both boxes look the same, with 4.1, one of them has flipped triangles

see issue setPreTransformMatrix does not affect triangle visibility

Sorry, I don’t have a playground yet because before extracting a simple standalone demo I wanted to ask if anyone has a hunch what the issue might be.

This is a transparent gray box, with two blue boxes sticking out and a yellow box inside the gray one. (The yellow one is exactly as tall as the gray one, that’s why there are these stripes)

Left: 4.2.0-beta.1 (and all versions before that):
Right: the latest (4.2.0-rc.1):

I hope the issue is visible in these two static images.

With the latest version, the triangles are flipped, you can see the inside of the boxes instead of the outside.

Literally the only difference is the version of babylonjs, I downgraded again which fixed the issue.

The reason I haven’t yet extracted a simple repo is that I am doing some weird stuff with transformations.

babylonjs is set to left-handed. I have some right-handed data that I manually convert to left handed with some transformation matrixes.

I load two glb models, set one as a child of the other, then set my data as a child of that.

There was a bug in VertexData.transform that led to a wrong winding after the matrix is applied, reported in the what’s new file by:

Fixed wrong winding when applying a transform matrix on VertexData (Popov72)

If the change was on purpose then that’s ok and I’ll change my code.

Apparently it is no longer possible to change the winding through a matrix transformation, which is actually what I wanted to do on purpose.

So I guess I’ll have to manually change the order inside the buffer.

1 Like

Yes, sorry, you used a bug that was not intented to be there!

1 Like