You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

1

Tuesday, May 24th 2011, 3:17pm

hlookatmin for pad

Can anyone tell me if ' limitview="range" hlookatmin="-80" hlookatmax="+90" ' should work on ipad?

I have the latest bugfixes and am able to restrict the view vertically but not horizontally.... I believe the code to be correct as it works fine on the desktop...
<view hlookat="0" vlookat="-20" fovtype="MFOV" fov="90" fovmin="75" fovmax="120"
limitview="range" vlookatmin="-90" vlookatmax="+60" hlookatmin="-80" hlookatmax="+90"/>

Can anyone help? I have foolishly (or not?) told the client that this horizontal restriction is possible as I have used vertical restrictions before and, logically, it never entered my head that horizontal would be any different.
My deadline is tomorrow!

If this line of code is not supported, does anyone have a work around?

As always, any comments are appreciated..... except those focusing on the 'foolishly' part of this thread! *cursing*

Kev

HansNyb

Professional

Posts: 1,008

Location: Denmark

Occupation: Photographer

  • Send private message

2

Tuesday, May 24th 2011, 3:24pm

Horizontal limit does not work on iPad.

Hans

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

3

Tuesday, May 24th 2011, 3:41pm

Thanks for your directness Hans.
I don't suppose you have any suggestions for a work around do you?

Kev

Posts: 1,853

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

4

Tuesday, May 24th 2011, 3:48pm

You could make a very rude action to pan to a home position when looking in that direction or just black it all out.
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

5

Tuesday, May 24th 2011, 4:30pm

<events onviewchange="stop();"/>

<action name="stop"
IF(view.hlookat GT 90, set(view.hlookat, 90));
IF(view.hlookat GT -90, set(view.hlookat, -90));
</action>

i think that might work but i have not tested it.

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

6

Tuesday, May 24th 2011, 4:49pm

this one works keeping viewing inside 0-90. could be changed to any number just make sure your starting view settings are in between your wanted restrictions.

<action name="stop">
IF(view.hlookat LT 0, set(view.hlookat, 0));
IF(view.hlookat GT 90, set(view.hlookat, 90));
</action>

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

7

Tuesday, May 24th 2011, 7:13pm

Cheers VN, I'll give that a try.... the client went nuts when I told him I couldn't restrict it!

Kev

HansNyb

Professional

Posts: 1,008

Location: Denmark

Occupation: Photographer

  • Send private message

8

Tuesday, May 24th 2011, 8:02pm

this one works keeping viewing inside 0-90. could be changed to any number just make sure your starting view settings are in between your wanted restrictions.

<action name="stop">
IF(view.hlookat LT 0, set(view.hlookat, 0));
IF(view.hlookat GT 90, set(view.hlookat, 90));
</action>


Tried it but it does not work on iPad at all.
I get some wrong restriction in Flash though.

Hans

9

Tuesday, May 24th 2011, 8:08pm

It worked on iPhone 4.

HansNyb

Professional

Posts: 1,008

Location: Denmark

Occupation: Photographer

  • Send private message

10

Tuesday, May 24th 2011, 8:12pm

It worked on iPhone 4.


Can you tell me exactly how you used it?

Diod you remove the other limits which work in flash.

How did you apply the action ?

Hans

11

Tuesday, May 24th 2011, 8:19pm

I actually left the other limits in place although they were set differently than my test. I simply copied the stop code from vn

<action name="stop">
IF(view.hlookat LT 0, set(view.hlookat, 0));
IF(view.hlookat GT 90, set(view.hlookat, 90));
</action>



and then found my events tag and added the

onviewchange="stop();" to that events tag.

HansNyb

Professional

Posts: 1,008

Location: Denmark

Occupation: Photographer

  • Send private message

12

Tuesday, May 24th 2011, 8:30pm

I seen it and it seems to work in a way.

But you put the events within scene 1 and it affects all scenes but in different ways depending on your initial view.

Have to try it again as this is exactly one of the ways I did it, except for the event was not within the scene tags.

Hans

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

13

Tuesday, May 24th 2011, 8:36pm

if you put it inside scene 1 it should only affect other scenes if you are using MERGE or KEEPVIEW or KEEPBASE. I tested it outside the scene tags however it was just a single pano so I could not speak for what Hans found.

HansNyb

Professional

Posts: 1,008

Location: Denmark

Occupation: Photographer

  • Send private message

14

Tuesday, May 24th 2011, 8:53pm

Got it working.
I do not have any scenes on this.
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.

<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

15

Tuesday, May 24th 2011, 9:14pm

Didn't even think about it affecting EVERY scene. I will get back to the drawing board and limit it to each scene in my test.

Still, this was a great idea, VN2011.

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

16

Tuesday, May 24th 2011, 10:13pm

To any of you who are interested, regarding the 'affecting all scenes' issue. Here's a work around:

I put <events onviewchange="stop();"/> within the scene of the restricted tour then created another action

<action name="cancelstop">
IF(view.hlookat LT -360, set(view.hlookat, -360));
IF(view.hlookat GT 360, set(view.hlookat, 360));
</action>

and within the next scene added <events onviewchange="cancelstop();"/>

This work for me on the desktop and ipad with no problems.

Thanks again VN... quick response has saved my a*s. *thumbsup*

Kev

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

17

Wednesday, May 25th 2011, 5:08am

glad this worked. ive been saved a few times in these forums dealing with last minute tweaks. kev just so you know another way to cancel the limits would be to just set the event onviewchange to empty quotes <events onviewchange=""/> then there would be no need to duplicate the action with he 360 rotation set. the empty event would overwrite the limits. basically doing the same thing with less code.

18

Wednesday, May 25th 2011, 10:41am

I posted this just a few days ago, which does the exact same thing in just one line.:
<events onviewchange="set(view.hlookat,0)"/>
Still good to see that others are trying to find a workaround too *thumbup*

But like I said in the other thread, this solution is far too slow and laggy for iDevices. The view-tag gets set new for every moved pixel, what means: 100 pixels movement per sec = 100 times reading and writing the view-tag. Your code, VN2011, is even a little slower, because of the fact that the action also needs to be calculated 100 times/s.

I tried to use the mouse.x/mouse.y-tags instead, but it´s just as slow. And searching the forum I found out that it´s possible to lock the mousewheel, but I found no way to lock the mouse.x-movement inside XML and JS is no solution for me :(

Keep brainstorming, guys! There has to be a solution *smile*
Best regards,
Nupsi

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

19

Wednesday, May 25th 2011, 12:50pm

another way to cancel the limits would be to just set the event onviewchange to empty quotes <events onviewchange=""/>
glad this worked. ive been saved a few times in these forums dealing with last minute tweaks. kev just so you know another way to cancel the limits would be to just set the event onviewchange to empty quotes <events onviewchange=""/> then there would be no need to duplicate the action with he 360 rotation set. the empty event would overwrite the limits. basically doing the same thing with less code.
I will definitely give both of these suggestions a try... as soon as I've rectified my sleep deficit which is the result of this latest project! *sleeping* Although I'm a bit dubious about empty events for the idevices as, in the past, I've discovered the this can cause issues.

Kev

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

20

Wednesday, May 25th 2011, 2:53pm

empty events for the idevices


i didnt think of that. i know empty urls break idevices so this might as well.