JohnK Posted January 19, 2016 Share Posted January 19, 2016 Using this code //leaf var r; var leaf_path = new BABYLON.Path2(0, 0); for (var i = Math.PI/6 + Math.PI/48; i <= 5*Math.PI/6; i+= Math.PI/48) { r = 1- Math.sin(3*i); leaf_path.addLineTo(r*Math.cos(i), r*Math.sin(i)); } var leaf_shape = new BABYLON.PolygonMeshBuilder("polygon", leaf_path, scene).build(); leaf_shape.rotation.x = -Math.PI / 2; leaf_shape.material = mat0; in the playground works great. The same code in my project (using BJS 2.3) does not work and I get the error message uncaught exception: PolygonMeshBuilder cannot be used because poly2tri is not referenced has something changed in 2.3 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 19, 2016 Share Posted January 19, 2016 Nope but you need to add a reference to poly2tri.js (https://github.com/BabylonJS/Babylon.js/tree/master/dist) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.