I want to record the perspective data when playing 360 video. I saw VideoDome has a rotation accessor, and I thought that saves the degree of rotating the perspective. However, after I rotated the perspective, I found that rotation accessor remained (0, 0, 0). So I wonder if there is anything that I can track the perspective data.
Thanks!
By “perspective data,” do you mean the direction the user is looking at times throughout the video? If so, I think the rotation you’re looking for is on the camera, not on the VideoDome. If that’s what you’re looking for, saving off a time-series of the camera’s orientation might give you what you need.
Thanks. That is what I mean. So could you please tell me how to get the camera’s orientation? Because I tried cameraDirection, cameraRotation, and rotation properties of camera, and none of these is the camera’s orientation.
If you check the console log, you should see a value being logged out constantly that changes when the camera’s orientation moves. To record which direction the user was looking in, all you should have to do is collect that data over time and eventually save it in a file somewhere. If this is what you were trying to do, I think the piece you were missing was line 20, where I add the logging code to an onBeforeRenderObservable so that it will be called repeatedly. createScene is called only once, when the application starts up, so any code that appears in there (or, equivalently, where createScene is called from) will only be executed once. You want to check the camera’s orientation repeatedly over time, so you need to add your code to an observable so that it’s run every time the scene renders a new frame. Hope this is helpful!