GithubHelp home page GithubHelp logo

jcasman / aframe-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from theta360developers/aframe-demo

0.0 2.0 0.0 60.37 MB

WebVR A-Frame demo for RICOH THETA

Home Page: http://theta360.guide/aframe-demo/

JavaScript 99.89% HTML 0.11%

aframe-demo's Introduction

This demo and information were built immediately after Kieran Farr gave a presentation on A-Frame at the RICOH THETA MeetUp in San Francisco in September of 2016. This readme is a copy of a short blog post that I wrote to help the parcipants load their own 360 images into a web site using A-Frame. There is a sample video that works on desktop, but doesn't work reliably on mobile phones yet. This is probably going to improve within months. The main point of this code example is to give people an experience of how easy it is to make applications with WebVR. In fact, it is so easy that it will change the business of VR in 2017. Saying VR will take off next year is old, we've been saying this for decades. The goal of this exercise is to get people to experience creating a simple 360 media site for Cardboard, Occulus, or Vive and make their own assessment. It's so easy to build content, that it will change your perspective on the entire VR industry.

The future of virtual reality and augmented reality is WebVR. It's open source JavaScript, works with browsers and mobile phones today. THETA media works great with it. Support for Occulus Rift and HTC Vive headsets is available today in development builds and will be available to the general public by the end of 2016.

It's easy to get started and powerful enough to build amazing applications.

Let's get started with a simple THETA VR site using A-Frame.

Using your mobile phone, go to this sample link:

https://codetricity.github.io/aframe-demo/scene1.html

Put the mobile phone in Cardboard and you'll be able to navigate the image by moving your phone.

The image will look like this. Press the goggle icon to split the image.

There's nothing unusual here except that the main code is one line.

Fork the sample code.

Copy your THETA pictures into the image sub-directory.

Open the file scene1.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>RICOH THETA MeetUp Test Scene 1</title>
    <meta name="description" content="Panorama โ€” A-Frame">
    <script src="dist/aframe.js"></script>
  </head>
  <body>
    <a-scene>
      <a-sky src="image/1.jpg" rotation="0 -130 0"></a-sky>
    </a-scene>
  </body>
</html>

Change src/1.jpg to the name of your file.

Push the file back up to GitHub Pages and view the URL in your browser. That's it. You can now refer to the A-Frame site to come up with ideas to build your interface.


Troubleshooting

If you open the file on your local computer without uploading to GitHub Pages, you may see this:

The error message in your JavaScript console will be:

Image from origin 'file://' has been blocked from loading by Cross-Origin Resource Sharing policy: Invalid response. Origin 'null' is therefore not allowed access.

The fastest way to sort this out is to simply to push to gh-pages. I'm assuming that you're familiar with gh-pages or can figure it out with a quick web search. The super short version: git add *, which will add all your files git commit -a, git push. Make sure you push to the gh-pages branch. Your site will be up at username.github.io/aframe-demo/scene1.html

chrome://flags

Resources

Analytics

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.