Sie sind nicht angemeldet.

deadbead

Anfänger

  • »deadbead« ist der Autor dieses Themas

Beiträge: 9

Wohnort: Russia, Saint-Petersburg

  • Nachricht senden

1

Montag, 29. März 2010, 22:19

Round and trunc functions

Hi!

When I'm doing with the auto-panorama, then after some time hlookat value exceeds 360. and sometimes more than 4000 (if the long turn), so if you switch to another panorama, and when calling the function tween (view.hlookat, 0) takes place a few spins around its axis before hlookat takes the value 0

I'm trying to solve it this way:

Quellcode

1
2
3
4
5
div(tmp,view.hlookat,360);
round(tmp,tmp,0);
mul(tmp,tmp,360);
sub(tmp,view.hlookat,tmp);
tween(view.hlookat, tmp);


but the function "round" or "reject" it seems no ...

How do I solve this problem?

P.S. А по русски тут кто-нибудь говорит?

2

Montag, 29. März 2010, 22:25

Hi deadbead,
  • adjusthlookat(desthlookat)
    • adjusts the hlookat value for manual tweening
    • it fixes the 360 wrap around for the shortest way to "desthlookat"
    • usage:

      Quellcode

      1
      2
      
      adjusthlookat(140);
      tween(view.hlookat,140);
SAlut.

deadbead

Anfänger

  • »deadbead« ist der Autor dieses Themas

Beiträge: 9

Wohnort: Russia, Saint-Petersburg

  • Nachricht senden

3

Montag, 29. März 2010, 22:51

It works!

Thanks for help ) I will try to be more attentive )