-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[third-person-camera] Using existing controls to move an avatar #427
Comments
Some demo by SéamusBoy shared on supermedium discord https://discord.com/channels/479784974917042186/479787777949433900/1147381168350703738 https://glitch.com/edit/#!/aframe-joystick-third-person @kfarr also have some notes here 3DStreet/3dstreet#338 |
Did some related work on a third person driving concept: The chase-camera.js implementation was based on an interesting idea of a "selfy stick" approach applied on a new copy of the look controls component. |
I started to play a bit creating a The important bit is that the camera entity shouldn't be inside rig, and no position should be set on it (it's actually similar to the orbit-controls component): <a-entity id="camera" camera></a-entity>
<a-entity id="rig" networked="template:#avatar-template;attachTemplateToLocal:false" player-info camera-controls>
<a-sphere position="0 0.75 0" radius="0.75"></a-sphere>
</a-entity> The camera position that can change is on the PerspectiveCamera, so the child of the camera entity, I get the camera with With |
Create an example similar to
https://8thwall.8thwall.app/navigation-mesh/
using nipple and keyboard controls and respecting the navmesh to move an avatar with a third person view.
This is mainly related to the camera here that needs to follow the avatar, and also rotate the avatar model according to the controls used.
I think
movement-controls="constrainToNavMesh:true;controls:keyboard,nipple"
on the avatar entity should work with an inactive camera as a child (movement-controls needs a camera as one of the child).Another component would take care of rotating the avatar model based on the movement direction, probably something to do in movement-controls component so that applies to any controls.
Any of you implemented something like that already? I'll gather any insights you may have.
Also see those threejs libraries related to camera:
The text was updated successfully, but these errors were encountered: