Andrey Zimin Posted January 23, 2018 Share Posted January 23, 2018 Hi friends. There are two questions, but they all refer to the same. The first question is why in this example the positions of the spheres does not coincide with the positions of the peaks of ground http://www.babylonjs-playground.com/#1J3WEP#137 And two question. Why when using MeshBuilder (line 29), the entire design stops working http://www.babylonjs-playground.com/#1J3WEP#138 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted January 23, 2018 Share Posted January 23, 2018 Positions are relative to the meshes origin, which is mesh.position. To get the absolute value of a vertex, add the appropriate value (x, y, z) to an element of the vertex positions array. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2018 Share Posted January 23, 2018 For question 2: there is a typo in the subdivisions property: http://www.babylonjs-playground.com/#1J3WEP#140 Andrey Zimin 1 Quote Link to comment Share on other sites More sharing options...
Andrey Zimin Posted January 23, 2018 Author Share Posted January 23, 2018 1 hour ago, JCPalmer said: Positions are relative to the meshes origin, which is mesh.position. To get the absolute value of a vertex, add the appropriate value (x, y, z) to an element of the vertex positions array. Friend, please, can this sample code to show? Here - > http://www.babylonjs-playground.com/#1J3WEP#137 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted January 23, 2018 Share Posted January 23, 2018 http://www.babylonjs-playground.com/#1J3WEP#141 ps you spelled subdivisions wrong. http://www.babylonjs-playground.com/#1J3WEP#142 Using Clones: http://www.babylonjs-playground.com/#1J3WEP#143 Using Instances: http://www.babylonjs-playground.com/#1J3WEP#144 <-best method Andrey Zimin 1 Quote Link to comment Share on other sites More sharing options...
Andrey Zimin Posted January 24, 2018 Author Share Posted January 24, 2018 10 hours ago, Pryme8 said: http://www.babylonjs-playground.com/#1J3WEP#141 ps you spelled subdivisions wrong. http://www.babylonjs-playground.com/#1J3WEP#142 Using Clones: http://www.babylonjs-playground.com/#1J3WEP#143 Using Instances: http://www.babylonjs-playground.com/#1J3WEP#144 <-best method Is very good and big big big thanks:)! But, ---> Error in mounted hook: "ReferenceError: i is not defined" there is a typo in the subdivisions property - const _s = new BABYLON.MeshBuilder.CreateSphere('s', { diameter: 0.5 }, scene) 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.