viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.29k stars 481 forks source link

Is is possible to use 360 Panorama(not equirectangular) in ARPortal? #340

Closed abhi06991 closed 6 years ago

abhi06991 commented 6 years ago

I have 360 panorama images(not equirectangular) with sizes like (1290X640), but these images gets too much stretched when viewing inside the ARPortal. Is there any way to show only panorama? or may be restrict the user movements when user tries to see upwards or downwards so that he doesnt see the stretched part of the image?

achuvm commented 6 years ago

Hi @abhi06991,

Unfortunately, there's no way around this if you want to use the Viro360Image component. Something that you can maybe consider doing is if you don't have too many assets, you can manually pad your images with extra alpha pixels, although, 1290x640 is very close to the 2:1 ratio that most 360 photos should be in.

We do plan on supporting semi-circular/spherical images in the future however, but there's no good way to do this on the platform at the moment.

Thanks,

abhi06991 commented 6 years ago

Hi @achuvm , I am sorry, that was a typo, the image dimensions are 1920X640 not 1290, so that is why it kinda looks stretched.

I just noticed that react-360 provides this option. https://facebook.github.io/react-360/docs/photos-and-videos.html#photos

Is it possible to integrate it in viro-react?

Personally, I like this platform and dont want to complicate things. When can we expect this feature in Viro-react?

Thank you.

achuvm commented 6 years ago

Hi @abhi06991,

Thanks for clarifying the image dimensions.

One option you can do right now is to create a curved surface object (.obj) and then use Materials to texture the object. This is effectively what happens when you "display" a 360 image; the provided image is textured onto a spherical object/geometry.

To your point about React-360, they too only support 360 or 180 equirectangular projections (as per your link).

We'll look into adding support for non-360 panorama photos/videos for our next release (we don't yet have a concrete date for that).

Thanks,

abhi06991 commented 6 years ago

Hi @achuvm

Thanx for the suggestion. I have few doubts,

1) By curved surface object, you mean like an object that is semi-circular ? 2) Is it possible to create a 360 effect if I have 4 images of dimension say 2048*2048, and by stitching them can I get a 360 effect ?

achuvm commented 6 years ago

Hi @abhi06991

  1. Yes, by creating an object that is single faced and curved, you can texture 1 side of it with your image
  2. It depends on whether or not the 4 images contain the full 360 content, if so, then you'd be fine. If not, then it wouldn't look right. Essentially a 360 photo (in 2D) is a Mercator projection of your surroundings. If your projection is off, then the mapping of each point back onto a sphere won't look right either.

Thanks,

dam00n commented 6 years ago

Closing this issue due to inactivity. If you are still experiencing issues, please re-open with additional comments so we can investigate further.