فهرست منبع

playground Mesh.CreateBox is deprecated

from https://forum.babylonjs.com/t/materials-not-working-box-wont-change-color/2788/3?u=vinc3r
Vinc3r 6 سال پیش
والد
کامیت
17dc2abbc6
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      Playground/scripts/basic scene.js

+ 5 - 5
Playground/scripts/basic scene.js

@@ -13,19 +13,19 @@
     camera.attachControl(canvas, true);
 
     // This creates a light, aiming 0,1,0 - to the sky (non-mesh)
-    var light = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(0, 1, 0), scene);
+    var light = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
 
     // Default intensity is 1. Let's dim the light a small amount
     light.intensity = 0.7;
 
-    // Our built-in 'sphere' shape. Params: name, subdivs, size, scene
-    var sphere = BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);
+    // Our built-in 'sphere' shape.
+    var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {diameter: 2, segments: 32}, scene);
 
     // Move the sphere upward 1/2 its height
     sphere.position.y = 1;
 
-    // Our built-in 'ground' shape. Params: name, width, depth, subdivs, scene
-    var ground = BABYLON.Mesh.CreateGround("ground1", 6, 6, 2, scene);
+    // Our built-in 'ground' shape.
+    var ground = BABYLON.MeshBuilder.CreateGround("ground", {width: 6, height: 6}, scene);
 
     return scene;