Giter Site home page Giter Site logo

aframe-trackball-controls-component's Introduction

A-frame Trackball Controls component

License

A Trackball Controls component for A-Frame.

API

Property Description Default Value
rotateSpeed Number โ€“ rotation speed 1

Installation

Browser

Install and use by directly including the browser files:

<head>
  <title>A-Frame using a Camera with Trackball Controls</title>
  <script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
  <script src="./aframe-trackball-controls-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity
          id="camera"
          camera="fov: 80; zoom: 1;"
          position="0 1.65 5"
          trackball-controls="
              rotateSpeed: 1.0;
              zoomSpeed: 1.2;
              panSpeed: 0.8;
              noZoom: false;
              noPan: false;
              staticMoving: true;
              dynamicDampingFactor: 0.3;
              "
          mouse-cursor="">
          <a-entity geometry="primitive:cone; radius-bottom:1; radius-top:0" scale=".33 1 .33" position="0 0 0" rotation="90 0 0" material="color: #0099ff; transparent: true; opacity:0.5"></a-entity>
      </a-entity>

      <a-entity id="target">
          <a-box id="box" position="-1 0.5 1" rotation="0 45 0" color="#4CC3D9"></a-box>
          <a-sphere id="sphere" position="0 1.25 -1" radius="1.25" color="#EF2D5E"></a-sphere>
          <a-cylinder id="cylinder" position="1 0.75 1" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
          <a-plane position="0 0 0" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
      </a-entity>

      <a-sky color="#ECECEC"></a-sky>
  </a-scene>
</body>

More information about the component and its options could be found on the three.js Trackball Controls

npm

Install via npm:

aframe-trackball-controls-component's People

Contributors

hassadee avatar

Stargazers

 avatar

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.