I am making a model viewer, and I need every model I feed the runtime to assume the camera’s viewing boundaries, so it’s always the same fit whether it’s a car, a building or a spec of sand. How can I do this?
UPDATE: What I have so far.
I am making a model viewer, and I need every model I feed the runtime to assume the camera’s viewing boundaries, so it’s always the same fit whether it’s a car, a building or a spec of sand. How can I do this?
UPDATE: What I have so far.
It may be enough to get the pertinent component’s bounds and scale it all up based on that value.
Well, have the camera pointing at the object, at a distance probably related to object bounds. Are you wondering about a formula?
I am actually trying to replicate the exact function of F button in viewport, focusing on a specific object. Is there some specific math for it? I don’t care about lerping it or timelining it, just boom.
Yes, I am looking for a formula. The one I use gets the item close to the reference cube’s size but not enough. I want the largest side of the model to fit the reference cubes scale.
every model I feed the runtime
to assume the camera’s viewing
boundaries, so it’s always the same
fit whether it’s a car, a building or
a spec of sand
but then
I am actually trying to replicate the
exact function of F button in viewport
I thought you wanted to blow up / scale down a model to fit into a static camera frustum accounting for fov, aspect ratio and so on. If you zoom in on a spec of sand, you’re gonna have bad time if you just move the camera around.
Other than that, ClockworkOcean seems to have you covered.