Aframe: Automatic rotation on 360掳 image

Created on 5 Dec 2016  路  6Comments  路  Source: aframevr/aframe

Description:

Hello,

Is it possible to make a 360掳 image automatically rotate at load, endlessly? I searched the docs, especially the "rotation" section but it does not seem to be able to rotate the image automatically.

What I would like as a final result is this: http://photo-sphere-viewer.js.org/

Thank you.

Most helpful comment

Just in case anyone is wondering, I managed to do it:

http://output.jsbin.com/mofuyavude

All 6 comments

Hi,
the rotation-attribute only rotates the object around the three different axes once on load. What you're looking for are animations, which you can attach to the 'a-sky'-element.

Like this:

<a-sky src="https://aframe.io/aframe/examples/boilerplate/panorama/puydesancy.jpg">
    <a-animation attribute="rotation" fill="forwards" easing="linear" dur="15000" from="0 0 0" to="0 360 0" repeat="indefinite"></a-animation>
</a-sky>

Example on jsbin http://jsbin.com/qacawoz/edit?html,output

See docs for further information about a-animations https://aframe.io/docs/0.3.0/core/animations.html

Awesome! Many thanks.

One more question, if I may: how can I stop the animation on click?

I tried end="click" within tag but it does not stops the animation on click.

Hi,

Once again, thanks for your argumented answer.

This may sound dumb, but I would like to display my photos with an animated 360掳 panorama on desktop like you did in the jsbin; the animation would stop after a click on the image.

On the other hand, if the user's device supports VR, like a smartphone for example, then it makes no sense to launch an animation and the default presets are good enough.

An other possibility would be to let the image spin indefinitely on any device, stopping the animation after a click (assuming we are not in VR yet) but enable VR, which would of course not be animated but controlled by phone's sensors.

You can see a live example here: http://jsbin.com/suwogaveju/edit?html,output

If I open the image on a smartphone, I see the animation until I tap it; when I enter in the VR mode I am controlling the animation.

I am not using this script because it is not actively maintained and VR support is filled with bugs.

I will join the channel, thank you!

Just in case anyone is wondering, I managed to do it:

http://output.jsbin.com/mofuyavude

Was this page helpful?
0 / 5 - 0 ratings

Related issues

greggman picture greggman  路  4Comments

FireDragonGameStudio picture FireDragonGameStudio  路  5Comments

jcarpenter picture jcarpenter  路  4Comments

rich311 picture rich311  路  3Comments

beyerz picture beyerz  路  3Comments