c-frame / aframe-stereo-component

aframe.io component to enable separate eye rendering of objects, plus stereo video rendering (full 360 or half dome)
https://c-frame.github.io/aframe-stereo-component/
MIT License
137 stars 52 forks source link

Does not work with images? #19

Open Runnermax opened 7 years ago

Runnermax commented 7 years ago

Hi :) First of all, thank you for fixing the component! Awesome component. :D But there is a slight problem. I am using stereo images and the component does not work with images. If i pull up two spheres and put images on both, i get both in either eye. If i change the asset type to video, the spheres get seperated correctly for both eyes (and ofc just black spheres^^). Is it possible to get images working too? :)))

Cheers, Max

oscarmarinmiro commented 7 years ago

Of course! I'll look into it ASAP. Do you have any boilerplate/sample code so I can test, of confirm me if I understood it correctly: You have to spheres, you put images on them (left eye image on one sphere, right eye image on the other), and you see both spheres in each eye?

Runnermax commented 7 years ago

Yes, exactly. I tried something simple, just copied your example code for the boxes. Put in two images as assets. As soon as you change the color in the material to the image src, the cubes will just be on both eyes, so i guess the stereo component gets overridden.

Runnermax commented 7 years ago

To clarify the situation: Lets say i have two images as assets. The override option for the camera is for the left eye.

So this works (i only see the red sphere): <a-entity geometry="primitive: sphere; radius: 1" material="color: red" position="2 3 -5" stereo="eye:left"></a-entity> <a-entity geometry="primitive: sphere; radius: 1" material="color: blue" position="2 5 -5" stereo="eye:right"></a-entity>

and this does not (i see both spheres with the pictures): <a-entity geometry="primitive: sphere; radius: 1" material="src: #bed_left" position="0 3 -5" stereo="eye:left"></a-entity> <a-entity geometry="primitive: sphere; radius: 1" material="src: #bed_right" position="0 5 -5" stereo="eye:right"></a-entity>

if i change the asset type to video, just for testing, i see only the sphere for the left eye.

SidOfc commented 7 years ago

Hi Oscar,

I'm having the same issue although a different method is used to create the scene. I've followed this tutorial: http://bl.ocks.org/bryik/68b4044557f25bd9c578540fc4969b65 to create a stereo projection of a left-eye and right-eye equirect. I've created a reproducible example here: https://github.com/floorplanner/pano-viewer/tree/development.

To get the demo up and running, simply clone the repository, cd into it and serve it from a web server (using something like npm serve: https://www.npmjs.com/package/serve) or change paths within debug.html to be relative so it works without a server and finally, go to the location of debug.html in chrome.

The expected result:

Actual result:

The received error:

Uncaught (in promise) TypeError: Cannot use 'in' operator to search for 'tagName' in #asset-left at s.init (http://localhost:5000/js/aframe-stereo.min.js:1:1084) at s.updateProperties (http://localhost:5000/js/aframe.min.js:143:2661) at new s (http://localhost:5000/js/aframe.min.js:143:3586) at HTMLElement.value (http://localhost:5000/js/aframe.min.js:135:4133) at HTMLElement.value (http://localhost:5000/js/aframe.min.js:135:5329) at e (http://localhost:5000/js/aframe.min.js:135:4920) at Array.forEach (native) at HTMLElement.value (http://localhost:5000/js/aframe.min.js:135:5136) at t (http://localhost:5000/js/aframe.min.js:135:3375) at http://localhost:5000/js/aframe.min.js:139:1249

It would be great if this component could also be used with images (for me, this would be equirect images). I basically have the same question as @Runnermax:

Is it possible to get images working too? :)))

Thanks in advance! Sidney Liebrand

jeroenVerdonschot commented 7 years ago

Sorry guys but after downloading the latest update (0.5.0). It still doesn't load an image. I now get the tagname error.

bryik commented 7 years ago

@SidOfc Sorry about that, the method I described in that block did work at one point. I'll look into it and update the example. Edit: I locked stereo component to the version from this commit for a quick fix to get the example working again.

IDK if it helps, but I recently used the stereo component for overunder images in this project. The examples still work as I write this (A-Frame version 0.4.0).

SidOfc commented 7 years ago

@bryik no worries at all! Thanks for including the commit and some examples to the working code!

nicnicp commented 7 years ago

I am trying to use this to display stereo images with no luck. works fine with colors, but it won't work if images are the source of the texture. I tried different file types, png, jpg, gif...

`<!DOCTYPE html>

` I am a complete noob with Aframe/webvr... anyone solve this?
oscarmarinmiro commented 7 years ago

Hi, sorry for the big hiatus...

I merged https://github.com/oscarmarinmiro/aframe-stereo-component/pull/21 and now I'm going to test with AFrame 0.6.0 and prepare a release for that version.

My question is, can anyone paste here a link to a pair of stereo equirectangular 360 images, a link for each eye? I'm going to add an example with images, but searching on the web for images I'm sure I'll run into copyright issues :)

bryik commented 7 years ago

@oscarmarinmiro Here is the sample I used for an Ansel test:

There are some more in this album, but they're not split.

oscarmarinmiro commented 7 years ago

Wow that pair is cool!! Thanks Ben!

oscarmarinmiro commented 7 years ago

Just included an image example in the pages and README, and tested on 0.6.0. Both videos and stereo images works now. Hope it all works fine. If anything breaks, just tell :)

https://github.com/oscarmarinmiro/aframe-stereo-component/releases/tag/v0.6.0

brianedward commented 5 years ago

Does this work by creating two cameras that are surrounded by a sphere textured with either the L or R photo/video?