Giter Site home page Giter Site logo

hhy5277 / holographicjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lwansbrough/holographicjs

0.0 2.0 0.0 8.24 MB

A Windows Runtime Component for hosting Windows Holographic apps built with Javascript and WebGL

License: Apache License 2.0

C++ 10.78% JavaScript 69.13% C 19.48% Objective-C 0.61%

holographicjs's Introduction

Microsoft has released an official replacement for this library

Stunning work by some of the folks at MS who have put together their vision for what this library should be. The result is nearly identical, so I'm recommending their library over this one. https://github.com/microsoft/holojs

HolographicJS

Join the chat at https://gitter.im/HolographicJS

A C++ Windows Runtime Component for hosting Windows Holographic apps built with Javascript and WebGL.

Purpose

To provide a familiar environment for web developers who are interested in holographic development for Microsoft HoloLens and Windows Holographic.

Demonstration of HolographicJS

Notes/Warnings

  • This library is completely devoid of memory management. I'm not a C++ developer so I've left memory management as an excercise for later
  • libEGL.dll and libGLES.dll were compiled using Microsoft's fork of ANGLE with support for Windows Holographic
  • At the moment, shaders for specific libraries have to be updated to support holographics

Approach

This project is very experimental, and as such I've taken some somewhat novel approaches to some difficult problems. Nothing provided here is recommended for production environments at this point.

HolographicJS is built atop large open source efforts, including:

The goal of this project is to achieve rendering holograms using Javascript with minimal or no adjustments to existing 3D libraries. Where required, HoloLens specific solutions should be employed.

Getting Started

  1. Clone the repo
  2. Open the HolographicJS solution
  3. Run the HolographicJSTest app on your HoloLens or HoloLens emulator
    • app.js is a demonstration of a plain holographic WebGL app in JS
    • app.three.js is a work in progress demonstration of ThreeJS support

Example

This is an example of how HolographicJS can be used within a Universal Windows app.

// Called when the CoreWindow object is created (or re-created).
void App::SetWindow(CoreWindow^ window)
{
    window->VisibilityChanged +=
        ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);

    window->Closed += 
        ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);

	try {
		holographicJS = ref new Host(window);
	}
	catch (Exception^ e) {
		OutputDebugString(e->Message->Data());
	}
}

// Initializes scene resources
void App::Load(Platform::String^ entryPoint)
{
	holographicJS->RunScript(L"app.js");
}

// This method is called after the window becomes active.
void App::Run()
{
    while (!mWindowClosed)
    {
        if (mWindowVisible)
        {
			CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
			holographicJS->ProcessNextTask();
		}
        else
        {
            CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
        }
    }
}

Roadmap

In no particular order:

  • Implement entire WebGL 1.x spec
  • Port to C++/WinRT for improved performance
  • Remove Edge Mode Chakra dependency
  • Provide high level interfaces for spatial mapping, shared experiences
  • Three.js support

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.