Giter Site home page Giter Site logo

Comments (3)

vincentfretin avatar vincentfretin commented on June 12, 2024 1

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.

vincentfretin avatar vincentfretin commented on June 12, 2024

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.

kfarr avatar kfarr commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.