Giter Club home page Giter Club logo

mathworldvr's Introduction

MathworldVR

MathworldVR

WebVR math platform made with A-Frame, Three.js, React, Redux.

Build Status Coverage Status Code climate tested with jest Tag License

Usage

  • Download and install a WebVR-enabled browser. Currently only Firefox, Firefox Nightly and experimental versions of Chromium supports the Vive controllers. (You will need to enable these flags for WebVR and Gamepad Extensions: chrome://flags#enable-webvr and chrome://flags#enable-gamepad-extensions.)
  • Visit https://mathworldvr.com/ and play with the math functions.

Libraries

App state in predictable state container

MathworldVR uses Redux for all the stuff around the app's state. It helps you write applications that behave consistently. On top of that, it provides a great developer experience, such as live code editing combined with a time traveling debugger. For example, CalcButton component used as a backspace on calculator is dispatching Redux action when user "clicks it" with VR hand-controller!

Stateless Calculator component:

const Calculator = ({ backspace }) => {
  return (
    <Entity className="interactive calculator">
      // ...
      <CalcButton value="<-" id="calc-backspace" actionToTrigger={backspace} />
      // ...
    </Entity>
  )
}

Calculator container:

import { connect } from 'react-redux'
import { Calculator } from 'components'
import { calculatorBackspace } from 'actions'

// ...
const mapDispatchToProps = (dispatch) => ({
  backspace: () => dispatch(calculatorBackspace()),
})

export default connect(mapDispatchToProps)(Calculator)

CalcButton nicely dispatching Redux action that we are passing to it dynamically on 'hover-start' event:

export default class CalcButton extends React.Component {
  startIntersection = () => {
    const { actionToTrigger } = this.props
    // Dispatching Redux action from within WebVR
    // by touching the CalcButton with VR hand-controller
    actionToTrigger()
  }

  render() {
    return (
      <Entity
        id={this.props.id}
        className="interactive button"
        hoverable
        clickable
        events={{
          'hover-start': this.startIntersection
        }}
      >
        <Text value={this.props.value} />
      </Entity>
    )
  }
}

Local Development

Prerequisites

First, fork the project. Then:

git clone [email protected]:yourusername/mathworldvr && cd mathworldvr
npm install // or yarn install
npm start

Then, load http://localhost:3000 in your browser.

Generating Builds

npm run build

Questions

For questions and support, ask on StackOverflow.

Stay in Touch

A-Frame Community

Contributing

Get involved! Check out the Contributing Guide for how to get started.

License

This program is free software and is distributed under an MIT License.

mathworldvr's People

Contributors

michaltakac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathworldvr's Issues

Dependencies not installing

The specific version of the "aframe" and "aframe-physics-system" packages are not being installed with npm install due to a dependency on another package called "cannon.js". I tried many solutions online regarding the attached error but none worked. I tried changing the versions of these packages such as [email protected] and [email protected] after which the packages were installed, but the result was a constant black screen when running the app. The project seems to depend solely on the [email protected] and [email protected], so any suggestions on how to get them to install?

Daydream support

Description:
Add support for the daydream platform

  • Platform / Device:
    Android, Daydream view + daydream controller

  • Reproducible Code Snippet or URL:

Unusable on Oculus Go

When the website is viewed with an Oculus Go, the user is in the middle of the main keyboard. The controller is visible to the far right but can’t access most of the buttons.

Add multiuser support

Description:
Multiuser support with Firebase or custom Elixir/Phoenix backend. First option easier, second unknown, but already experimenting with it in another side-project.

Project fails to build

The command npm run build fails due to removed Babel Stage presets, even after attempting update with npx babel-upgrade.

  • Platform / Device: Windows 10 - Node 10 - Babel 7
  • Reproducible Code Snippet or URL:

Failed to compile

npm: 5.6.0
node: 8.11.2

npm start failed, error message:

「wdm」: wait until bundle finished: /
「wdm」: Failed to compile.

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.