juanmajr93 Posted January 19, 2017 Share Posted January 19, 2017 Hi all, Are there any way to set my import mesh (obj) to height of ground? I have done something similar with SPS but in this case I have to do this with differents meshes which have been imported to scene. Thanks! Quote Link to comment Share on other sites More sharing options...
jerome Posted January 19, 2017 Share Posted January 19, 2017 mesh.position = ...? Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 19, 2017 Author Share Posted January 19, 2017 @jerome ,you know very well my scene http://217.217.131.1:8081/ Today I have added one element and it is another mesh. I need set all "y" values of mesh to adapt them to the level of ground. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @juanmajr var y = ground.getHeightAtCoordinates(x, z); // Getting height from ground object http://www.babylonjs.com/Demos/INSTANCES/ @Deltakosh Chrome 57... Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 19, 2017 Author Share Posted January 19, 2017 @Nabroski yes I have used this method but I need to change the height of all points of mesh to adapt over the ground, it is like set a heightmap to mesh instead of terrain. It is similiar if you have an unique mesh of all trees of your example and later you have to adjust them over the ground. To understand me better please visit my scene. http://217.217.131.1:8081/ Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @juanmajr93 I guess you mean than not all your meshes are at same height, i think, theirs is somewhere a 'bug' in your code. It should work. i think, maybe make a callballfunction, if every building has loaded then apply new height Try to simply as much as possible. Your Site need damn long to load, maybe you can improve this too. Sorry i cant help you any further, this needs time for debug. Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 19, 2017 Author Share Posted January 19, 2017 @Nabroski mesh buildings have this height because I set them by this way. I am only interested in gangway mesh that I would like to set at the same level of ground. Now I can only adjust origin point of this mesh but not all vertex which are in the base of it. Maybe I think that the solution is to edit this mesh... Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 jerome 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @juanmajr93 where is it ? http://217.217.131.1:8081/assets/modelos/ Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @juanmajr93Solutions 1. 2. Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 19, 2017 Author Share Posted January 19, 2017 @Nabroski the mesh name is pergolas, it must be at the same height of ground! Quote Link to comment Share on other sites More sharing options...
juanmajr93 Posted January 19, 2017 Author Share Posted January 19, 2017 @jerome Could I add label to sps particle with canvas 2D? I need to use BabylonJS 2.6v-alpha or not?¿?¿? Quote Link to comment Share on other sites More sharing options...
jerome Posted January 20, 2017 Share Posted January 20, 2017 of course you can... just have a read at Canvas2D documentation and examples 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.