Hi all. Is there a way to move the ArcRotateCamera in this example code so that the cube mesh is at the bottom of the viewport?
I am able to change the the arc size with
camera.setPosition() but the cube always seems to remain in the center of the viewport; I am unable to get a typical third-person camera view, but I really like everything else that the code does.
Just like that, I would have said ‘targetScreenOffset’ but to be honest I haven’t been able to make it work with your code. I think basically your gonna need an offset on y from your player target but you’ve already implemented all sorts of behavior and updates to the camera and player and the ground is also not at zero and currently I can easily offset the screen so that the ground is at the bottom but the cube falls through the ground. Anyways, I believe this could work. Just need to find how to implement it in your scene.
Maybe @PolygonalSun will have an idea?
thanks for that… yeah I am thinking maybe a different type of camera will be needed instead of the ArcRotateCamera. I was poking around for an offset as well. Anyways, thanks for taking the time… Also I am not too attached to that code… it’s something I found on the playground and modified slightly.
targetScreenOffset vector will shift where the camera is looking so you can move your focal point on the screen while maintaining your camera’s target. Keep in mind, this adjustment is with respect to your local viewpoint, not with respect to your camera’s position in WORLD space. Keep in mind though, depending on the effect that you’re going for, you may need to adjust the offset when your radius changes.