google / marzipano

A 360° media viewer for the modern web.
http://www.marzipano.net
Apache License 2.0
2k stars 997 forks source link

[Question] Render custom hotspots into canvas #280

Open ondrej-vipo opened 4 years ago

ondrej-vipo commented 4 years ago

Hello, Is there any way to render custom "hotspots" into canvas itself via webgl?

tjgq commented 4 years ago

There isn't, sorry. We decided to implement hotspots using DOM elements because they're more versatile (you can render any DOM content, not just images).

Can you explain a little bit more about your use case, and why DOM-based hotspots aren't suitable?

ondrej-vipo commented 4 years ago

@tjgq Hello, I would like to display panoramas with hotspots in VR and my understanding of WebVR is that only stuff from canvas is beeing displayed on VR screen.

tjgq commented 4 years ago

Yes, that's a WebVR limitation; all it does is display a canvas, there is no DOM.

The point of hotspots is interactivity; if you're on WebVR all you can display is static content, is it not? At that point, why not pre-render the hotspots on top of the panorama?

jordyno commented 4 years ago

@tjgq what are the benefits of using WebVR as opposed to side-by-side demo? The side-by-side version seems to be supporting all of the features. Is there a major performance boost with WebVR? Or compatibility?

ondrej-vipo commented 4 years ago

@tjgq Well thats the thing: I wanted to set/unset the hotspots based on server response that I can get via ajax call.

ondrej-vipo commented 4 years ago

@jordyno I think the only way is to use WebVR for devices like HTC Vive

romangrinev commented 2 years ago

Can you explain a little bit more about your use case, and why DOM-based hotspots aren't suitable?

Another reason to render hotspots into canvas is to may polygonal hotspots. I was wondering can create a canvas layer and draw polygonal hotspots there using canvas functions.