Gyroscope sensor


#1

Hello. I am using 360 virtual tours with zapworks studio, but unfortunately, in some phone that do not have gyroscope sensor, the 360 tours will not work.
simply they can not change the angle of view.
is there a solution for this kind of issue?


#2

as i see i need to add pointermove event.
i will add pointermove event on the photo sphere,
but what kind of event i need to add ?
can you please guide me ?
with ready code, or ready ZPP file !
it is very important please.
the user who do not have gyroscope they can use the finger to change the view.


#3

I made a quick file for you. I took bradleycox255 file from is post.
(2d towards camera) and changed it to move a photo sphere.

Photo-Sphere-Gyroscope Touch.zpp (1.3 MB)

Steve


#4

Hello, thank you for your responding .
it is very nice … and good support.
i have question, if i had more than 1 photo sphere, and inside the photo sphere there is hot spot, when i am clicking on this hot spot, i will go to the second sphere.
can you explain me what is the steps i need to do ?
i need to add 2 planes ? with 2 scripts pointermove ?
i notice that the hotspot change his x,y location while i am touching with my finger, and also the hotspot not responding :(…

hope you can guide me more, or if you can to send us ZPP file that contain 2 photo spheres, and 1 hotspot .
this will improve zappar forum more, becasue there is a lot of systems that do not have gyroscope in the systems …


#5

Hi,

There is a tutorial in our documentation that takes you through step by step how to transition from one photosphere to another using a button.

There are some advanced techniques in this tutorial including headset view and raycasting but chapter 8.5 there is a diagram which explains how you can position the 2 spheres without them overlapping.

Chapter 22 explains how you can then transition between the 2.

The tutorial can be found here: [Transitioning Photospheres] (https://docs.zap.works/studio/tutorials/transitioning-photospheres/)

Hope this helps,
George


#6

Hello.
thank you for your time.
how i can make this code :

var mObj = symbol.nodes.Photo_Sphere; //the node or object you want to rotate
var lastX : number // This is needed for storing distance between frames.
var lastY : number // This is needed for storing distance between frames.
const rotSpeed = 180; // Constant to be multiplied by movement on the plane to determine how fast the object will rotate.

// This function activates when the user moves thier finger on surface covered by the parent plane object.
parent.on(“pointermove”, (_e)=> {
let _distX = _e.localPosition[0] - lastX; // how much we’ve moved between frames.
let _distY = (_e.localPosition[1] *-1) - lastY; // how much we’ve moved between frames.

let _rot = mObj.rotation();                 // Get current rotation so we can alter one axis.


_rot[1] += _distX * rotSpeed;    // change the rotation based on distance, multiplied by desired speed factor.
_rot[0] += _distY * rotSpeed;    // change the rotation based on distance, multiplied by desired speed factor.

mObj.rotation(_rot);            // Set the nodes rotation to the new rotation.

lastX = _e.localPosition[0];  // record where the user is touching the screen this frame for next time they move.
lastY = _e.localPosition[1] * -1;  // record where the user is touching the screen this frame for next time they move.

});

// This function is also necessary to get the initial position of the users touch.
parent.on(“pointerdown”, (_e)=> {
lastX = _e.localPosition[0]; // Set initial position when user touches the screen.
lastY = _e.localPosition[1] * -1; // Set initial position when user touches the screen.
});

to work only for x axis, when the user will touch the screen left and right on x axis ( not top and down ).
Mean when the user will touch and drag the screen top and donw nothing to happen, only when thew user will drag left and right on the screen to change the view left and right !

Thank you


#7

i am sure that the zpp file you sent me not working good, i am testing it from both iphone and ipad, and it work randomly, sometime it working and other not working Photo-Sphere-Gyroscope Touch.zpp
Can you please check it again ?


#8

To only move the x axis rem out this line.

// _rot[0] += _distY * rotSpeed; // change the rotation based on distance, multiplied by desired speed factor.

I did not code for orientation. It works in landscape mode.You will have to add a rotation of the TouchSurface in controllers under portrait. Also if you are using a device with a gyroscope it may move on you.

Steve


#9

Hello, Thank you for your support.
but i need little bit your support, because i have confuse.
the ZPP file that you sent me not working.
i am downloading it , and publishing it , without any change, and it is not working .
can you please re check this ZPP file ?
it not working on iphone and ipad.
there is no touch at all , it change view only with gyroscope only.


#10

That mean the ZPP file you sent me work randomly. it may work , and may not.
it may work in iphone first scan , and second scan not.
really i am confuse:(…


#11

Hi @eliaskhs,

I have just tested the ZPP file that Steve has kindly added. It works perfectly although, just like what has been mentioned before, it is defaulted to the landscape mode. I personally turned down the speed in which the rotation was occurring from 180 to 100 but this is your personal preference.

Removing the line of code _rot[0] += _distY * rotSpeed; will stop the Y axis from moving, baring in mind this is only in landscape mode so could act wrongly dependant on how the device is held.

Hope this helps,

George


#12

Thanks George.
I was just looking at it as well.
@eliaskhs what exactly are you needing? It would make things easier to help you.

Steve


#13

I am really confusing.
are you sure that the ZPP file working?
it is 2 days trying to understand what going on.
imported the zpp file to my studio, last version of zapwork studio.
and then published it. but there is mo respond at all to my touch.
testing from iPhone x, iPad

.
please test this zapcode, and check how it not working.
so what is the issue?


#14

Photo-sphere-Elias.zip (1.3 MB)

This is the ZPP file.


#15

I don’t know what to tell you but your zapcode works every time for me on an Iphone and Samsung.

Steve


#16

#17

here 2 video, shows .
from the same system, and same time .
1 show how it working, and other how it not working .

you can check please!


#18

How we can debug this issue please?
Thank you for your time .


#19

Here is may zapcode I use for testing.
I have loaded the edited file that will only go left and right only.
I also fixed it to work in landscape or portrait.


#20

Really i do not know what to tell you .
it work only the first time i scanned the zapcode, second time not working …
Really i am confusing, do not now what to do.
i am sure there is issue in the file, how i can debug the file, so i send you debuging file, to check what is the issue, i do not think that the issues from new iphone x, or ipad pro.