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

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: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

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: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 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: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

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: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 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: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

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: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
Zapiens
Posts: 10
Joined: Tue Apr 28, 2020 4:51 pm

Thank you very much, I will continue my search :D
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Tony.
Please forgive me if this is a reply to a very old post.
Can you please tell us how to implement this wonderful feature?
Thank you in advance.

Tony wrote: 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
User avatar
Tony
Posts: 1341
Joined: Mon Feb 15, 2010 6:54 am
Location: Adelaide, South Australia
Contact:

Hi,

You can download the project files here https://p2vrtutorials.s3.ap-southeast-2 ... dow-V2.zip

cheers,

Tony
Tony Redhead | Panoramic Photographer | mobile: +61438501002 | website: https://tonyredhead.com - https://redsquare.com | Pano2VR Tutorials: https://tonyredhead.com/pano2vr | instagram: https://www.instagram.com/tonyredhead/
User avatar
Taka
Posts: 51
Joined: Fri May 28, 2021 3:15 pm
Location: Tokyo

Tony wrote: Thu Oct 06, 2022 8:37 am Hi,

You can download the project files here https://p2vrtutorials.s3.ap-southeast-2 ... dow-V2.zip

cheers,

Tony
Tony

Thank you for your quick response.
I will test it and play around with it.
Cheers!
Post Reply