Jump to content

Trouble with width/height options on CreatePlane


Recommended Posts

I am building a racquetball court. (for a first person racquetball game.)

I am having trouble customizing the width and height options for CreatePlane.

I found this thread. It looks like i'm doing it right, but its not working.

This is the playground, started from  "Drag and Drop".


The left wall is the one in question. So the wall would show, i commented out the line with {width: 400, height:200} and just put in "200".

line 32.

//not working: var leftWall = BABYLON.Mesh.CreatePlane("leftWall", {width:400,height:200}, scene);
var leftWall = BABYLON.Mesh.CreatePlane("leftWall", 200, scene);


(perhaps i've been looking at this too long...)

Thanks again!

Link to comment
Share on other sites

Hello again gson78, and hi to all others, too.  NasimiAsl gave a good answer, but you might desire avoiding scaling.


Gson, take a look at  http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter


AFTER the date of the forum message you saw, some things changed.  When using a parameters object { ... } to construct mesh, we now use MeshBuilder instead of Mesh.


So, try...

var leftWall = BABYLON.MeshBuilder.CreatePlane("leftWall", {width:400,height:200}, scene);

That should work, too.  Sorry for the confusion... that's an outdated forum post.  Party on!

Link to comment
Share on other sites



perfect.  Funny how the helpfulness of search results depends on whether you know what terms to search for.  That page could have been one of the links in the documention i didn't click on.


now that I have that working, I finish the scene, and then its on to physics!


@nasimiASl  thanks, sure i will probably use the scaling thing at some point.

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.

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.


  • Recently Browsing   0 members

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