svelte-babylon
svelte-babylon copied to clipboard
Create an example where you can build a custom Polygon
I find it quite difficult to build a <Polygon> with this code:
<Polygon
options={{
shape: [
new BABYLON.Vector3(2, 0, -2),
new BABYLON.Vector3(2, 0, 0),
new BABYLON.Vector3(3, 0, 2),
new BABYLON.Vector3(1, 0, 2),
new BABYLON.Vector3(-3, 0, 3),
new BABYLON.Vector3(-3, 0, 1),
new BABYLON.Vector3(-2, 0, -2),
new BABYLON.Vector3(-2, 0, -3),
new BABYLON.Vector3(2, 0, -3),
],
depth: 1,
}}
/>
So I would like an example where using it is possible to create a custom polygon on the fly.