Bug with Extrude Polygon?

Extrude polygon only works if polygon is defined in xz plane?
https://playground.babylonjs.com/#KDPAQ9#4729

This works.

    const outline = [
        new BABYLON.Vector3(0, 0, 0),
        new BABYLON.Vector3(0.5, 0, 0),
    ]
    outline.push(new BABYLON.Vector3(0, 0, 0.5));
    outline.push(new BABYLON.Vector3(0, 0, 0));

This doesn’t?

  const outline = [
        new BABYLON.Vector3(0, 0, 0),
        new BABYLON.Vector3(0.5, 0, 0),
    ]
    outline.push(new BABYLON.Vector3(0, 0.5, 0));
    outline.push(new BABYLON.Vector3(0, 0, 0));

From the docs Irregular Polygons | Babylon.js Documentation (babylonjs.com):

2 Likes

Isnt it a pretty strange restriction, the one related to the xz-plane?

This is just by convention, but it doesn’t change anything as you can always rotate your object after it’s constructed.

1 Like