turn 360 degrees around

  • Hi,

    I've made a button which, when pressed, rotates the panorama 360 degrees around. But there is a issue with it. The screen goes blanc when I press it and I don't know why.

    Code
    oninterrupt(stopall());
    trace(view.hlookat);
    inc(view.hlookat, -360);
    trace(view.hlookat);
    lookto(view.hlookat, 0, 90, smooth(80,20,20));

    The traces show the correct numbers when i press the button (0 and minus 360), but it doesn't get parsed well in the lookto I think.

    First I thought It was because the view.lookat isn't in the range of -360 to 360 that lookto requires. but even subtracting 10 degrees results in the same. (I got the latest Beta).

    then I tried a differentapproach

    Code
    add(dst,view.hlookat, 360);
    lookto(dst, 0, 90, smooth(80,20,20));

    Results in the same, blank screen, compass dissapears.

  • Hi,

    in the lookto() action only "values" can be passed, not variables!

    this will cause this behavior, the variable can't be converted to a number
    and as result the hlookat becomes an invalid number (NaN) which results in a "blank" view
    I will change that in the next version to ignore wrong inputs,

    to get it correct working you need to use - get(variable) - to pass the value of a variable,
    e.g.:

    Code
    lookto(get(view.hlookat), 0, 90, smooth(80,20,20));


    or:

    Code
    lookto(get(dst), 0, 90, smooth(80,20,20));

    best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!