mwpowellhtx Posted March 29, 2016 Share Posted March 29, 2016 I am getting an error with the latest BABYLON 2.3 (NuGet): //var gn = this.getName; //var cg = BABYLON.Mesh.CreateGround; //totalLength, calculated elsewhere //s === scene this.field = cg(gn("field"), { width: totalLength, height: totalLength }, s); Yield: Uncaught TypeError: Cannot read property 'addMesh' of undefined. Stack trace: babylon.js:5 Uncaught TypeError: Cannot read property 'addMesh' of undefined i @ babylon.js:5 r @ babylon.js:11 i @ babylon.js:20 t.CreateGround @ babylon.js:12 r.CreateGround @ babylon.js:12 build @ gridiron.js:146 createScene @ TestFixture.html:79 (anonymous function) @ TestFixture.html:109 That I know of, I was not receiving the same error in 2.2.0. I'll try downgrading and see if that makes a difference. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 Sounds like CreateGround works: http://www.babylonjs-playground.com/#1UY4SH#0 Quote Link to comment Share on other sites More sharing options...
jerome Posted March 29, 2016 Share Posted March 29, 2016 Maybe you used Mesh.CreateGround with an object parameter {} instead of MeshBuilder.CreateGround ? Quote Link to comment Share on other sites More sharing options...
mwpowellhtx Posted March 29, 2016 Author Share Posted March 29, 2016 It worked under 2.2.0; when I replace it with 2.3.0, now it is broken. Quote Link to comment Share on other sites More sharing options...
mwpowellhtx Posted March 29, 2016 Author Share Posted March 29, 2016 Ground behavior has definitely changed. I updated to call the non-object-param instead. That much works fine enough. // perhaps subdivisions: 1 is incorrect? this.field = BABYLON.Mesh.CreateGround(_gn('field'), totalLength, totalLength, 1, s); However, now the field lines are not rendering. These are created with a rotated CreatePlane. Perhaps they could be created with CreateGround as well, but I do not know what the dynamics are, per se, why they would suddenly not be showing up. Apart from the CreateGround nuanced call, the only difference is the version, swapping this: <script src="BabylonJS.2.2.0/content/scripts/poly2tri.js"></script> <script src="BabylonJS.2.2.0/content/scripts/oimo.js"></script> <script src="BabylonJS.2.2.0/content/scripts/babylon.js"></script> <!-- <script src="babylonjs.2.3.0/content/scripts/poly2tri.js"></script> --> <!-- <script src="BabylonJS.2.3.0/content/scripts/oimo.js"></script> --> <!-- <script src="BabylonJS.2.3.0/content/scripts/babylon.js"></script> --> For this: <!-- <script src="BabylonJS.2.2.0/content/scripts/poly2tri.js"></script> --> <!-- <script src="BabylonJS.2.2.0/content/scripts/oimo.js"></script> --> <!-- <script src="BabylonJS.2.2.0/content/scripts/babylon.js"></script> --> <script src="babylonjs.2.3.0/content/scripts/poly2tri.js"></script> <script src="BabylonJS.2.3.0/content/scripts/oimo.js"></script> <script src="BabylonJS.2.3.0/content/scripts/babylon.js"></script> See attached images. Quote Link to comment Share on other sites More sharing options...
mwpowellhtx Posted March 29, 2016 Author Share Posted March 29, 2016 BABYLON.Mesh.CreateGround is the better choice with 2.3.0 changes. Thank you... GameMonetize 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.