Giter Club home page Giter Club logo

aframe-in-app-browser's Introduction

AFRAME In-App Browser

Demo

This project is still a WIP!

This in-app browser uses a headless browser with off-screen rendering as a companion app to paint frames from webpages to a texture in aframe. The companion app is based in electron ( server.js ) and recieves mouse and keyboard events from the front end. This allows for a fully isolated browser experience inside of aframe for doing things like Oauth, or just general browsing in VR.

Inspiration

I wanted to port my scene editor built in Altspace VR to the browser as a standalone aframe based project. AltspaceVR provided a renderTarget based solution allowing you to render a browser to a texture. This project hopes to provide a similar solution in that it will support multiple browser plugins to allow you to connect to and remote control a remote browser inside VR.

Here is a demo of the new aframe based Shane's Editor that this will be used in: Demo

The Shane's Editor project is also open source and you can get involved at github, join our discord or take it for a test drive in the live demo

I will get a demo in place soon but for now here's the details to get you started.

Getting Started

Installing

npm i aframe-in-app-browser

Running

npm start

Building

npm run build

Example

<a-scene stats>
    <a-entity id="camera" camera="near:0.1;far:1000"  look-controls > <!--wasd-controls-->
        <a-entity id="cursor" cursor="rayOrigin: mouse" ui-mouse-shim
                  raycaster="far: 30; objects: .intersectable;"></a-entity>
    </a-entity>

    <a-entity light="type: ambient; intensity: 0.5;"></a-entity>
    <a-box color="#efefef" side="back" scale="10 10 10"></a-box>

    <a-entity position="0 0 -1">
        <a-plane height="0.1" width="1.7" shader="flat" color="#009688" curved-plane position="0 0.55 0"></a-plane>
        <a-plane height="1" width="1.7" shader="flat" browser ui-double-click curved-plane class="intersectable"></a-plane>
    </a-entity>
</a-scene>

TODOs:

  • Need to finish the address bar to allow for navigating to other sites.

aframe-in-app-browser's People

Contributors

sidequestlegend 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  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  avatar  avatar

aframe-in-app-browser's Issues

Electron start run in webhost

Hello Shane

How are you from Brazil?

Congratulations about your codes.

We trying to put your codes aframe-in-app-browser in our WebHost ( Alibaba Cloud ) but when deploying /dist folder, we don't see Electron library ( server.js file ).

How step-by-step to run in our webhost with server.js too?

We need to run to all our users your project.

Thanks for your return.

want to ask about how you get the formula of mouse event?

so i also had a similiar approach with your code but instead of electron im using puppeteer, want to ask can you explain how to convert the coordinate in aframe into browser coordinate i have set my browser to 1080x640 but the mouse click is still wrong, i'm using your formula:

   let localPoint = this.el.object3D.worldToLocal(intersection.point);
            // Normalise the point in the range of the companion app resolution 1080X640
            let mouse = {
                x:((localPoint.x+(1.6/2))/1.6)*1080,
                // Invert the Y coordinate for top down orientation of the browser coordinates.
                y:640-(((localPoint.y+(0.9/2))/0.9)*640)
            };

the 1.6 is the width and the 0.9 is the height, really appreciate if you can help as this is a really helpful repo, also your discord invite link is invalid btw so i hope i can ask you in discord too

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.