Coder Social home page Coder Social logo

aframe-crawling-cursor's Introduction

Crawling Cursor

An A-Frame component to move cursor along object's surface.

DEMO PAGE (link)

DEMO

API

Property Description Default Value
target selector(#id) of a cursor null
offset distance cursor hovers over intersection point 0.05 (meters, or 5cm)

Usage

1.put a-cursor object in a document.

<a-cursor></a-cursor>

2.set raycaster and crawling-cursor component on camera object.

<a-camera raycaster crawling-cursor></a-camera>

options

If you want a entity to be a cursor, you can set id on 'target' property.

<a-camera raycaster crawling-cursor="target: #my-cursor"></a-camera>
<a-ring id="my-cursor"></a-ring>

If you want some object to avoid intersection, add ignore-ray class to them.

<!-- cursor will not be along with this box -->
<a-box class="ignore-ray"></a-box>

Installation

browser

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
  <script src="https://cdn.rawgit.com/jujunjun110/aframe-crawling-cursor/master/dist/aframe-crawling-cursor.min.js"></script>
</head>

<body>
  <a-scene>
    <a-cursor></a-cursor>
    <a-camera raycaster crawling-cursor></a-camera>
  </a-scene>
</body>

npm

Install via npm:

$npm install aframe-crawling-cursor

Then register and use.

require('aframe');
require('aframe-crawling-cursor');

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.