Hi,
letting the object rotate by changing the crop are would be possible,
but using the mouse to rotate it currently not,
I prepared quickly two examples with your image:
here the object rotates always:
HTML:
http://krpano.com/examples/108b8/examples/vrobj/vrobj1.html
XML:
http://krpano.com/examples/108b8/examples/vrobj/vrobj1.xml
and here only when the mouse hovers it:
HTML:
http://krpano.com/examples/108b8/examples/vrobj/vrobj2.html
XML:
http://krpano.com/examples/108b8/examples/vrobj/vrobj2.xml
here the code to let the object rotate:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
<hotspot name="vrobj"
url="fenykepezo_crop.png"
ath="0"
atv="0"
zoom="true"
crop="0|0|333|285"
frame="0"
lastframe="20"
frameheight="285"
onloaded="animate();"
/>
<action name="animate">
inc(frame,1,get(lastframe),0);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|333|285');
delayedcall(0.1, animate() );
</action>
|
I used three custom variables:
"
frame" - for the current(first) frame (0-based)
"
lastframe" - the number of the last frame
"
frameheight" - the height of one frame in pixels
after the image was loaded the "
animate" action was called,
in this action the "
frame" number was increased and looped from "
0" to "
lastframe",
then the crop y-position was calculated -
ypos = frame x frameheight,
and finally the "
crop" attribute was build by connecting these texts:
'0|' + get(ypos) + '|333|285' together
this was the code for the next frame,
to animate it the same action was called after a short delay again,
best regards,
Klaus