text: [{"Owner":"iiceman","Date":"2016-01-07T11:42:53Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hey guys_co__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I am trying to place some boxes randomly on a heightmap. Easy_co_ eh? Well_co_ therefor I want to determine the current altitude at some random coordinates by casting a ray to see where it intersects with the ground mesh as suggested here_dd_ _lt_a href_eq__qt_http_dd_//www.html5gamedevs.com/topic/2248-retrieve-heightmap-altitude/_qt__gt_http_dd_//www.html5gamedevs.com/topic/2248-retrieve-heightmap-altitude/_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_That_t_s what I got so far_dd_ _lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#HLQ0L%230_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#HLQ0L#0_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_But it always returns a hit_dd_ false ... I feel like I am missing something here or just doing it wrong but I can_t_t seem to figure out what. Any idea?_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-07T13:20:09Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt__lt_a href_eq__qt_http_dd_//doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#ground-from-a-height-map_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#ground-from-a-height-map_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I guess you should get the altitudes in the _lt_em_gt_CreateGroundFromHeightMap()_lt_/em_gt_ _lt_u_gt_callback_lt_/u_gt_ function. Indeed_co_ it takes some time to download the heightmap image file_co_ so the mesh isn_t_t yet computed when the function _lt_em_gt_CreateGroundFromHeightMap() _lt_/em_gt_returns._lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_You could also use the dedicated method _lt_em_gt_getHeightAtCoordinates(x_co_ y)_lt_/em_gt_ which returns the y value (x_co_ z and y are the coordinates in the ground system)._lt_/p_gt__lt_p_gt_I re-implemented this method yesterday_co_ I don_t_t think the last version is still in the PG._lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"iiceman","Date":"2016-01-07T13:52:05Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Sweet! Thanks a lot jerome! _lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#HLQ0L%231_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#HLQ0L#1_lt_/a_gt_ _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_biggrin.png_qt_ alt_eq__qt__dd_D_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/biggrin@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Edit_dd_ But it_t_s not always the right position... sometimes they are too low_co_ sometimes to high... am I using it wrong?_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Wingnut","Date":"2016-01-07T14:06:13Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Hi Ice!_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt__lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#HLQ0L%232_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#HLQ0L#2_lt_/a_gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I switched lines 19 and 20.  When you called ground.getHeightAtCoordinates(x_co_ z)... z was still undefined/undeclared.  Party on!_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-07T14:17:56Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Wingut _dd_ eagle eyes !_lt_/p_gt__lt_p_gt_can find a bug from 20000 feet high _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_laugh.png_qt_ alt_eq__qt__dd_lol_dd__qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_I_t_m implementing a new method for height maps _dd_ getNormalAtCoordinates()_lt_/p_gt__lt_p_gt_This will return you the vector normal to the map at the current (x_co_ z) coordinates._lt_/p_gt__lt_p_gt_This will be useful for having meshes waving under the surface _dd_ y + val only is not efficient when the mesh is moving above a very inclined facet for instance_co_ you may want to shift it along the normal._lt_/p_gt__lt_p_gt_This will be useful to compute a slope also _dd_ dot product (normal_co_  axis Y) if we want to give a mesh a direction according to the ground inclination for instance... almost physics_co_ but without any engine _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_wink.png_qt_ alt_eq__qt__sm_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/wink@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_[EDIT] _dd_ PRed_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"iiceman","Date":"2016-01-07T15:27:17Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Thanks wingy... guess I was too excited and got carried away! _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_wink.png_qt_ alt_eq__qt__sm_)_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/wink@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_@jerome_co_ taht sounds pretty useful indeed. Can we expect to see some examples soon? _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_biggrin.png_qt_ alt_eq__qt__dd_D_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/biggrin@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-07T16:19:18Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_example as soon as the feature is pushed in the PG_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"iiceman","Date":"2016-01-07T16:33:09Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_Cool. I am currently playing around here_dd_ _lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#PSKRF%235_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#PSKRF#5_lt_/a_gt_ I want to make the selection circle using decals. It seems to work fine so far but the performance when making a selection is pretty bad... I think it_t_s because of the constant ray picking... would your new function help to avoid that? _lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-07T17:18:26Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_yep_co_ no more ray picking !_lt_/p_gt__lt_p_gt_have a look at this coming in the PG soon _dd_ _lt_a href_eq__qt_http_dd_//www.html5gamedevs.com/topic/15523-getheightatcoordinates-alternative/?p_eq_110642_qt__gt_http_dd_//www.html5gamedevs.com/topic/15523-getheightatcoordinates-alternative/?p_eq_110642_lt_/a_gt__lt_/p_gt__lt_p_gt_already in the 2.3_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"iiceman","Date":"2016-01-07T18:54:41Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_So cool! Good job!_lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_Especially this one looks so cool_dd_ _lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#1QC4YQ%234_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#1QC4YQ#4_lt_/a_gt_ We can finally create the ants simulation that we have always dreamed of _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_biggrin.png_qt_ alt_eq__qt__dd_D_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/biggrin@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"jerome","Date":"2016-01-07T19:32:44Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_you_t_ve got such weird dreams_co_ nope ?  _lt_img src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_tongue.png_qt_ alt_eq__qt__dd_P_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/tongue@2x.png 2x_qt_ width_eq__qt_20_qt_ height_eq__qt_20_qt__gt__lt_/p_gt__lt_p_gt_ _lt_/p_gt__lt_p_gt_with the getNormalAt(x_co_ z) you_t_ll be able to rotate/orientate the mesh according to the surface also_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]