Try this in the non limited view scenes.
<events onloadcomplete="set(events.onviewchange,null);" />
Try this in the non limited view scenes.
<events onloadcomplete="set(events.onviewchange,null);" />
Hi,
the 1.0.8.14 supports 'named' event tags,
see here:
https://krpano.com/download/beta/#2011-04-04
this allows to create several event tags,
and without keep="true" that event will be automatically removed when loading the next pano,
e.g. with the latest 1.0.8.14 you could do that inside a <scene> or pano to limit the view the simple way between 0 and 90:
<events name="hlookatlimits" onviewchange="math.max(view.hlookat,view.hlookat,0); math.min(view.hlookat,view.hlookat,90);" />
best regards,
Klaus
Can you give a snippet of code that shows multiple event tags as well as including an event that we are already accustomed to?
Thanks,
Jarred
Should this snippet have worked as is placed into a scene?
It did not work for me. Verified using the latest swf.
It didn't work for me either. I figured I had done something wrong but I know I am using the latest swf and js from 5-20-11. I was hoping an example would set me straight.
Hi,
Should this snippet have worked as is placed into a scene?
It did not work for me. Verified using the latest swf.
e.g.
<events onxmlcomplete="trace(global onxmlcomplete event);" />
<events name="test1" onxmlcomplete="trace(test1 onxmlcomplete event);" />
<events name="test2" onxmlcomplete="trace(test2 onxmlcomplete event);" />
and note - the 'named' events - that means <event> tags with a name, have also a "keep" flag,
and they will be removed when loading the next pano when keep was not set to true,
It didn't work for me either. I figured I had done something wrong but I know I am using the latest swf and js from 5-20-11. I was hoping an example would set me straight.
I have checked my code again and found a small bug in the Flash version regarding the "onviewchange" event,
I'm still checking if the global "event.onviewchange" was set before dispatching the "onviewchange" event to all other events tags...
this bug will be fixed in the next release,
in meantime it would be nesecery to write the code like this (just set the global onviewchange to anything, e.g. a empty string) to get the onviewchange event working also the 'named' event tags:
<events onviewchange="" />
<events name="hlookatlimits" onviewchange="math.max(view.hlookat,view.hlookat,0); math.min(view.hlookat,view.hlookat,90);" />
best regards,
Klaus
Thanks for the reply, Klaus!
And sorry if this is a dumb question, because I´m still at the beginning of programming, but how differs your code from
<events onviewchange="set(view.hlookat,0)"/> ?
I mean, your code works just as fine, but sadly it´s just as slow on iDevices as the one-liner And the view is´nt really locked to 0, because it´s still possible to move beyond +-0, it just flips back to 0 if the mouse button (or finger) is released.
I tried to lock instead the mouse.x-value this way:
<action name="ml">
set(mpos,mouse.x);
sub(movex,mpos,mpos);
set(mouse.x,get(movex));
</action>
But that´s not working either.
And may I repeat my question from the other thread and ask if we can expect the hlookatmin/max-tags for idevices somewhere in the near future - maybe with the public release of 1.0.8.14?
Best regards,
Nupsi
How come you talk about flip back to 0.
What device are you using?
The first code suggested by VN2011 works fine on my iPad.
It does not flip back to zero.
http://www.panoramas.dk/2010/queen-margrethe-birthday.html
The limits for the flash are +95 -95
To get the same with the action I used this. As you can see I used the devices setting to restrict it for only HTML5 as the standard limits work fine for flash.
<events onviewchange="stop();"/>
<action devices="html5" name="stop">
IF(view.hlookat LT -40, set(view.hlookat, -40));
IF(view.hlookat GT 40, set(view.hlookat, 40));
</action>
Hans
Hey Hans,
I´m trying to lock the hlookat completly at 0° on iDevices, instead of limit the range from -x to +x. And when I use the "onviewchange"-method, the view is´nt really hardlocked to 0, like it would be using the hlookatmin/max-tags. And when you look up and down this way, the view kind of whobbles on the x-axis and can even be dragged far beyond 0 and jumps then back to 0 if you release mouse button/finger.
Oh...and I´m using the iPhone/iPad-Simulator from Klaus and the iPad1 and iPod touch (first gen.) for testing.
I hope you get what I mean, because my english is´nt the best, as you may noticed already
Best regards,
Nupsi
Hello everyone,
I'm trying to achieve a horizontal limit in my pano for iPad, and I tried your solution but somehow it makes little "jumps" because its checking every movement, is there a way to avoid those "jumps"? The client really doesn't like them and he can't make a 360 panorama and the deadline is very near.
this is what I'm doing:
Is it different from hanss version? I dont see any little jumps on his.
no, its the same. Actually Hans pano also makes this little jumps when you try to keep rotating beyond the limit.
As far as I can see this is still not as good as the Flash solution, since it pins the centre of the screen at the specified position. Depending of the zoom value the edge of the screen will either not reach the edge of the pano, or go beyond it. Using Flash and limitview="offrange" and hlookatmax="nnn" the edge of the screen is pinned at the edge of the pano.
Is there a better workaround, or can the Flash functionality be provided?
With thanks,
Tony.
Well, you just half to calculate the range yourself.
Get the fov, divide by two and do your check to see if you're in or out of your viewing range and set your view accordingly.
Limits are going to be automatically supported in the next major krpano release however.
Hello,
Yes, I worked that out and did it (for the horizontal axis), but:
1. It doesn't work for vertical fov, because there is no variable telling me that (or at least I cant find it), and
2. It doesn't give accurate results for both portrait and landscape views. One can tune to one or the other, but not both.
I am glad to hear that limits are coming - any idea of a date for that??
With thanks, Tony
Just click the advanced for the documentation.
https://krpano.com/docu/xml/#view.vfov
Ah! thanks.
I had not properly sorted out the distinction between the Read-Only attributes and the Read-Write one.
Regards, Tony
Don’t have an account yet? Register yourself now and be a part of our community!