Page 1 of 1

drag and drop component

Posted: Fri Aug 14, 2020 7:42 pm
by Zapiens
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?

Re: drag and drop component

Posted: Mon Aug 17, 2020 3:23 am
by Tony
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

Re: drag and drop component

Posted: Mon Aug 17, 2020 10:09 pm
by Zapiens
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 !

Re: drag and drop component

Posted: Tue Aug 18, 2020 7:50 am
by Tony
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

Re: drag and drop component

Posted: Tue Aug 18, 2020 1:28 pm
by Zapiens
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!

Re: drag and drop component

Posted: Tue Aug 18, 2020 3:24 pm
by Tony
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

Re: drag and drop component

Posted: Thu Aug 20, 2020 8:25 pm
by Zapiens
Thank you very much, I will continue my search :D

Re: drag and drop component

Posted: Mon Oct 03, 2022 7:24 am
by Taka
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

Re: drag and drop component

Posted: Thu Oct 06, 2022 8:37 am
by Tony
Hi,

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

cheers,

Tony

Re: drag and drop component

Posted: Fri Oct 07, 2022 3:27 am
by Taka
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!