exolun Posted March 12, 2018 Share Posted March 12, 2018 Hi folks, I'm working on creating a custom shape using polygons for each side in world space around a given object, but when I call CreatePolygon it isn't producing the results I expect. Below is a playground with the example: http://playground.babylonjs.com/#8B86V8#3 I've done a little digging that has led me to believe that CreatePolygon only works with points aligned upon an axis as though it's a 2D shape. (Using X/Z components only, or X/Y etc). Is this assumption correct? If so, what should I use instead of CreatePolygon to create a custom shape in world space? (I'm looking to generate something similar to a frustum with a box at the end around an object, between the camera and the target object) Quote Link to comment Share on other sites More sharing options...
Guest Posted March 12, 2018 Share Posted March 12, 2018 Pinging @JohnK Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 13, 2018 Share Posted March 13, 2018 Quote from documentation of http://doc.babylonjs.com/how_to/parametric_shapes#non-regular-polygon Quote All vectors for shape and holes are Vector3 and should be in the XoZ plane, ie of the form BABYLON.Vector3(x, 0, z) and in counter clockwise order; Once produced you can rotate and position as you wish. GameMonetize 1 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.