8Observer8 Posted March 4, 2018 Share Posted March 4, 2018 This is the final code from the official tutorial: https://playground.babylonjs.com/#Y092BP If you open the official tutorial you will see this line of code in the beginning of the tutorial: // create a built-in "ground" shape; var ground = BABYLON.Mesh.CreateGround('ground1', {height:6, width:6, subdivisions: 2}, scene); But in the final code you will see this line of code: // create a built-in "ground" shape; var ground = BABYLON.Mesh.CreateGround('ground1', 6, 6, 2, scene); If I write {height:6, width:6, subdivisions: 2} instead 6, 6, 2 the code doesn't work: https://playground.babylonjs.com/#Y092BP#1 But for a sphere this works: {segments:16, diameter:2} Quote Link to comment Share on other sites More sharing options...
MarianG Posted March 4, 2018 Share Posted March 4, 2018 Hi. If you want to use a custom build of a basic element, you have to use MeshBuilder, instead of Mesh, for your example: // create a built-in "ground" shape; var ground = BABYLON.Mesh.CreateGround('ground1', 6, 6, 2, scene); and // create a built-in "ground" shape; var ground = BABYLON.MeshBuilder.CreateGround('ground1', {height:6, width:6, subdivisions: 2}, scene); // not BABYLON.Mesh It is a mistake on the doc, it'll be fixed. 8Observer8 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 4, 2018 Share Posted March 4, 2018 Have updated, will appear when `documentation` is next re-built. 8Observer8 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.