Jump to content

Mesh.CreatePolygon with 3 dimensional points?


exolun
 Share

Recommended Posts

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)
 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...