Jump to content

Mesh.CreatePlane Size Option


Ricebandit
 Share

Recommended Posts

I'm a TOTAL noob with BabylonJS, so please correct me if I'm wrong on this.

It looks like the size option for Mesh.CreatePlane isn't working as intended.

I'm looking to define the dimensions of a plane with this:
 

var plane = new BABYLON.Mesh.CreatePlane("plane_0", {width:10, height:5}, scene);




However, this results in the plane not being drawn in. When I look at the git version of Mesh>>babylon.mesh.js
Mesh.CreatePlane is assigning the size parameter to both width and height:


       

Mesh.CreatePlane = function (name, size, scene, updatable, sideOrientation) {
            var options = {
                size: size,
                width: size,
                height: size,
                sideOrientation: sideOrientation,
                updatable: updatable
            };
            return BABYLON.MeshBuilder.CreatePlane(name, options, scene);
        };



I dug into the minimized version and applied it like this to make it work as intended:

CreatePlane=function(t,i,r,n,o){var s={size:i,width:i.width,height:i.height,sideOrientation:o,updatable:n};


 

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...