Comments (3)
I started to play a bit creating a camera-controls
component that I created from this meshwalk example
https://yomotsu.github.io/meshwalk/examples/5_terrain.html that is using threejs camera-controls (MW.TPSCameraControls extends CameraControls), MW.KeyInputControl, MW.CharacterController, and an octree for the collision to the navmesh.
Now I understand a bit better the different parts, I think it should be possible to use a modified version of movement-controls
with it, also using aframe-extras nav-mesh
or simple-navmesh-constraint
instead of the octree for collision.
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 document.querySelector('#camera').getObject3D('camera')
in my camera-controls
component.
With movement-controls
, keyboard-controls
moves the rig, gamepad-controls
moves the rig and rotate the rig, so we should be able to use it. nipple-controls
moves the rig but rotate the camera via look-controls
that is a child the rig, so this one should be modified to rotate the PerspectiveCamera directly. Someone gave me a PS5 controller, I need to test it with gamepad-controls
, I think this controls is compatible with that and not just Quest joysticks.
from aframe-extras.
Some demo by SéamusBoy shared on supermedium discord https://discord.com/channels/479784974917042186/479787777949433900/1147381168350703738
https://glitch.com/edit/#!/aframe-joystick-third-person
and
https://glitch.com/edit/#!/reliable-universal-hardware
The models are from Synty Studios.
NOTE: The models are from the Free Synty Starter Pack: https://syntystore.com/products/polygon-starter-pack
@kfarr also have some notes here 3DStreet/3dstreet#338
from aframe-extras.
Did some related work on a third person driving concept:
https://glitch.com/edit/#!/aframe-throttle-accelerator?path=chase-camera.js%3A1%3A0
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.
from aframe-extras.
Related Issues (20)
- c-frame registry HOT 2
- Propagate the enabled flag to controls HOT 1
- aframe-inspector-plugin-recast not maintained HOT 5
- Animation-mixer support for multiple animation clips
- Animation does not Work in Version (0.9.0) HOT 1
- [animation-mixer] multiple external animations HOT 3
- [keyboard-controls] Add support for up down movement with configurable keys HOT 5
- [keyboard-controls] Press shift to run HOT 2
- [nipple-controls] rotation joystick only and move forward
- [Animation-mixer] crossFadeDuration not accepting values less than 1 HOT 3
- Help with playing animation backwards HOT 2
- Perform action as animation completes HOT 3
- Help with nipplejs controls HOT 1
- Error running `npm run dev`: Cannot find module 'three' HOT 1
- Adding a Thumbnail image to Green Screen Video HOT 2
- Look Controls / mouse drag/ camera rotation speed or rotation sensitivity does not behave accordingly HOT 5
- [nav-agent] switch to recast-navigation-js dependency HOT 2
- [nav-agent] navigation-impossible event
- [animation-mixer] timeScale -1 not working for gltf animation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aframe-extras.