buildar / awe.js

The jQuery for the Augmented Web
515 stars 113 forks source link

Adding a custom canvas into AWE projection #16

Closed dvenkatsagar closed 7 years ago

dvenkatsagar commented 8 years ago

Hi,

Im experimenting with the AWE.js and I find it really cool. I have a WebGL canvas scene that gives a rubiks cube. (taken from here : https://github.com/blonkm/rubiks-cube). Now I would like to add this canvas to the awe projection. I know that the add function takes in a object with a geometry property which has a shape attribute, but other than that, I cant seem to find any example which allows one to add a custom scene or anything else.

I also know that, using JSARtoolkit, one can add a custom threejs scene by giving a canvas element as a parameter (from here : http://learningthreejs.com/blog/2012/03/12/augmented-reality-in-the-browser/). Is it possible to do something similar in this? Help is appreciated.

Thank you

robman commented 7 years ago

Hi @dvenkatsagar apologies for the lack of replies while we were in stealth mode. You can checkout our updated repos at https://github.com/awe-media/awe.js - this includes an updates jsartoolkit demo in examples/marker_ar.

Also checkout the docs in the wiki and hopefully that will answer your question. In terms of adding a canvas - you can just convert any canvas to an image using .toDataURL() to create a png that you can then use as a texture. Hope this helps and feel free to raise any issues in the new repos.