Create polygon with 3D points

Babylon.js Playground (babylonjs.com)

Hello,
I have to make a roof made of a couple of polygons that were provided in WKT (WKT string of 1 polygon is in playground in a comment). My problem is that I can’t really make it generate or be visible in any way. PolygonMeshBuilder takes only Vector2 array and I have 3 numbers to include, so I thought CreatePolygon would do it, but no luck either.

I used an offset on your coordinates, else polygon is very far away and ground is not next to polygon,. Another way is to move camera target/position to polygon coordinates, but the y-Value seems to be quite big, maybe you need to scale down your values by i.e. 0.001.

The playground:

Note: First and last Vector3 are equal.

1 Like