text: [{"Owner":"royibernthal","Date":"2017-03-25T19:02:38Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI_t_m trying to center a 3D object in a scene (for the sake of this question).\n_lt_/p_gt_\n\n_lt_p_gt_\n\tCalculating stage size simply according to canvas dimensions doesn_t_t work_co_ e.g. if in PG the canvas width is 960_co_ then the x position of the sphere can be between around -10 to 10 meaning the _qt_screen width_qt_ I can play with is around 20.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tI imagine I need to somehow take into account the camera z_co_ and possibly other parameters.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tHere_t_s a PG where you can see more or less what I_t_m trying to do_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a href_eq__qt_http_dd_//www.babylonjs-playground.com/#AURQY_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//www.babylonjs-playground.com/#AURQY_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tBy the way I_t_m not looking for some workaround of setting the camera target to an object or something of the sort_co_ I_t_d like to really understand how to calculate such a thing.\n_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":"JCPalmer","Date":"2017-03-26T15:49:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tThis is going to involve the camera.FOV since the value assigned affects how far away things look at the same position.  In another _lt_a href_eq__qt_http_dd_//www.html5gamedevs.com/topic/29295-fish-eye-and-reverse-fish-eye/_qt_ rel_eq__qt__qt__gt_thread _lt_/a_gt_I took snapshots of the effects of changing this.  Here I was trying to get images of the same size_co_ so I had to move the camera or they would not be.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIn your research_co_ FOV plays into defining the _lt_a href_eq__qt_https_dd_//en.wikipedia.org/wiki/Viewing_frustum_qt_ rel_eq__qt_external nofollow_qt__gt_frustrum_lt_/a_gt_.\n_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":"royibernthal","Date":"2017-03-27T14:24:14Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tThanks_co_ I_t_ll look into it\n_lt_/p_gt_\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":"Deltakosh","Date":"2017-03-27T18:31:15Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tHello I think you can use the scene.getWorldExtends() which returns an object with two properties_dd_ min and max which are vector3 representing the bounding box of the world\n_lt_/p_gt_\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":"royibernthal","Date":"2017-03-27T21:34:58Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tSounds good _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\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_"}]