Jump to content

"Zoom all" with bounding box


Recommended Posts

hi everyone!

i'm trying to make a function that zooms my scene to fit all screen.

this is a playground example of my code: http://playground.babylonjs.com/#EHLMG#2

you can ignore the computeBounds() and drawBox() functions, they are only auxiliary tools.

as you can see, the function doesn't fit the entire node on screen... :(

do i have to make some computations on the fov parameter? or is it just the obvious angle of view of my camera?

thank you!


Link to comment
Share on other sites


i thought that fovMode VERTICAL_FIXED meant that the fov parameter, free to change, was the HORIZONTAL fov!

it's related to the VERTICAL fov, instead...

in fact, thinking about it, two fov parameters can't exist in the same context.


now i have another problem.

when at runtime i change my camera's fovMode, i don't see any change at screen.

i've to manually edit fov parameter to see some changes. why?


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...