drag and drop component

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 pm

Fri Aug 14, 2020 7:42 pm

Hi!

I want to build a "drag and drop" component, so viewers can interact with pictures and move them around.

I'm thinking ...

Var1 : X mouse position
Var2 : Y mouse position

And then, on the picture :
actions / click mouse / position and size / define position ...

And then, I would put var1 and var2 in the picture position

But I don't know how to connect the mouse position to var1 and var2

Any hint anyone?
User avatar
Tony
Posts: 989
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Mon Aug 17, 2020 3:23 am

Hi,

Here's a sample test I did quite a while ago. Is this the sort of thing you are looking for?

https://p2vrtutorials.s3-ap-southeast-2 ... index.html

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 pm

Mon Aug 17, 2020 10:09 pm

Thanks Tony for the answer.

I think I wasn't clear in my first message, sorry for that. English is not my first language, and I'm tring hard to learn pano2vr.

Inside the pano pictures, I wonder if it is possible to move pinned pictures by clicking on it and moving the mouse. Kind of a "drag and drop" effect.

For exemple, in this picture, I would like the visitors to be able to move "le Bunker de la Science" logo and put it where they want. Could it be done?

https://www.bunkersciencevr.com/reception-atomik/

The reason for this is that I'm tring to build "games" inside my Bunker (my business), using pano2vr. If the games could have some drag and drop challenges it would be more interactive than just answering questions. For exemple, put right item on the right table...

Thanks for your help !
User avatar
Tony
Posts: 989
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Tue Aug 18, 2020 7:50 am

Hi,

Unfortunately, I don't think it's going to be possible to make that pinned element draggable.

In my example that's an HTML page opening in an iframe, a javascript coder could possibly get it to work within the dom but that's a bit beyond me sorry.

cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 pm

Tue Aug 18, 2020 1:28 pm

Oh I didn't see the Iframe is moving! :shock:

I'm curious, how did you do that, maybe can start from there.

Thanks for your time!
User avatar
Tony
Posts: 989
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Tue Aug 18, 2020 3:24 pm

Hi,

The iFrame isn't moving it's fixed at 100% x 100% it's the div that's inside the iFrame that's draggable. Unfortunately, you can't access anything underneath the iFrame as it is permeable is inactive :-(

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: http://tonyredhead.com - http://redsquare.com | roundme: http://round.me/@tonyredhead | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 pm

Thu Aug 20, 2020 8:25 pm

Thank you very much, I will continue my search :D
Post Reply