Project

General

Profile

Third person camera - best practice?

Added by Yom Ti Dom 2 months ago

I want to create a 3rd person camera in the avatar-selection space (and in other worlds) and would like to know what is the best way forward:

1. customize input of the existing universalCamera from world.js
or
2. introduce a new camera like a BABYLON.FlyCamera or a even second BABYLON.UniversalCamera
or
3. something completely different

So I have to render+animate the selected avatar while navigating and would like to be able to switch between 3rd and 1st person.

My worry is that if I choose the wrong path, a lot of the existing vrspace-features might become buggy so I better ask first because pretty sure there are elegant ways prepared already !


Replies (1)

RE: Third person camera - best practice? - Added by Josip Almasi 2 months ago

Have you seen avatar-test.html yet? https://www.vrspace.org/babylon/avatar-test.html
How does that one suit you?

That one is BABYLON.ArcRotateCamera. It features limits on angles and whatnot. This isn't exactly 3rd person camera, as it's not bound to avatar (i.e. doesn't have avatar root mesh for parent), but I think you're not asking for 3rd person camera exactly, just better option to preview avatars.

There's plenty of stuff to optimize on that one, regarding mouse wheel speed etc. I think start here, and play in the playground for a bit: https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#arc-rotate-camera

Would you like to contribute?
Switching cameras on avatar-selection.html would make a nice contribution.

    (1-1/1)