Out of curiosity I was wondering how I could keep a target (or better yet everything in a scene) constantly in view no matter how the scene changes?
ie. if I have a sphere A at 0,0,0 with a radius of 20 and I add sphere B at -50,0,0 with the same radius I’m hoping that the viewport will have the left tip of sphere B at the very left edge of my screen and Sphere A’s right tip on my viewports right.
Oh man, yeah that’s pretty much exactly what I needed. Sorry about that I would have found it myself if I looked through these docs. Looks like they were updated recently too.
@Deltakosh your suggestion really saved me! I managed to get exactly what I needed implemented BUT there’s some weirdness happening I don’t fully understand despite reading the docs.
In the video I’m demoing how the camera is behaving. I don’t want any animation enabled as I’m just using the positioning component. My “frame” or artwork exists at 0, 0, 0 at all times. I then position a wallpaper behind it, position it then use zoom to focus on the frame components.
I have to position the wallpaper below the artwork and position the camera at the correct spot then trigger the zoom as such:
The above code is triggered when I click on the room view icon. The environment loads with a bit of an angle on the camera. When I actually click on the canvas/environment for some reason the correct orientation kicks in. I’m trying to ensure the room is not skewed at all.
I’m not familiar with this camera behaviour so I’m at a loss for why it’s performing this way.
Yeah I usually provide a playground link. This one is far more involved and will take me a bit to recreate. I’ll try and do it tomorrow but perhaps just the video will trigger some thoughts.
Basically I’m wondering if the camera behaviour has any actions on click that could possibly be doing this. My ArcRotateCam doesn’t do anything strange except for this behaviour. I have no idea where this click action is coming from and I can constantly recreate it (as seen in the video).
So I didn’t think so. I think this is a symptom of something else but having a heck of a time tracking it. Let me spend some time tomorrow recreating it in a repro. Obviously if it works properly in a playground sandbox then I’m obviously having app specific trouble. I’ll get back to you shortly hopefully soon.