shaderViewport movement isn't straight

  • #1, z ke4Saturday, 06. May 2017, 14:00 hodinky 8 years ago
    Hi,

    I'm having this kind of issue. I zoomed through the shaderViewport into a scene. Now i want a slow camera zoom out effect. The problem is that the zoom out isn't straight movement - it goes to the right and back while zooming out which doesn't make any sense to me.

    Setting the zoom:
    shaderViewport(1.5, 315, 95, 0, 0, easeLinearInOut)


    When i want the zoom out:
    shaderViewport(1, 0, 0, 0, 2500, easeLinearInOut)

    Btw how do i matematically calc the offset that the camera needs in a 16:9 scene if i want to zoom exactly to the center? I don't want to guess it grin

    Zabiják klíčů

    810 Posts


  • #2, z SimonSSaturday, 06. May 2017, 14:04 hodinky 8 years ago
    If you're using the newest version, there is a function
    function shaderViewportInterpolationPoint(x,y) 
    

    You can set it to 0.5,0.5, which will interpolate through the center position, default is 0,0 meaning the left top position.

    Kapitán

    1582 Posts

  • #3, z ke4Saturday, 06. May 2017, 14:09 hodinky 8 years ago
    Thanks Simon, works great!

    Zabiják klíčů

    810 Posts

  • #4, z genaticstudioSaturday, 18. January 2020, 15:04 hodinky 5 years ago
    How to use function?
    I use it but nothing happens.

    Bažant

    20 Posts

  • #5, z SimonSSaturday, 18. January 2020, 16:07 hodinky 5 years ago
    Check the log or press tab and check lua errors.

    Kapitán

    1582 Posts

  • #6, z genaticstudioSaturday, 18. January 2020, 18:07 hodinky 5 years ago
    I copied from " Shader Toolkit". Why doesn't it work?
    Can you recommend a solution?

    Bažant

    20 Posts

  • #7, z afrlmeSaturday, 18. January 2020, 18:11 hodinky 5 years ago
    Where did you get the shader toolkit script from? The one on the wiki is out of date. The up to date one is here.

    Imperátor

    7285 Posts

  • #8, z esmeraldaSaturday, 18. January 2020, 21:25 hodinky 5 years ago
    In the screenshot the execute script is: shaderZoom(1, 500, easing)
    Shoudn't the easing be specified? Like easeLinarIn, easeQintOut ...
    Could that be the problem?

    Zabiják klíčů

    525 Posts

  • #9, z genaticstudioMonday, 20. January 2020, 05:21 hodinky 5 years ago
    OK."Shader Toolkit"No problem.    Why doesn't it work?
    Am I using the wrong function? 
    i use fuction at begine of scene.

    Bažant

    20 Posts

  • #10, z afrlmeMonday, 20. January 2020, 11:56 hodinky 5 years ago
    Check your spellings mate. easeLinarIn > easeLinearIn.

    @Esmeralda: tsk tsk, I see it was you that told them the incorrect spellings. grin

    Easings can be found here: https://easings.net/en but In, Out, InOut goes on the end & not where it says on that page. For example: easeInSine would be easeSineIn in Visionaire.

    Imperátor

    7285 Posts

  • #11, z genaticstudioMonday, 20. January 2020, 14:35 hodinky 5 years ago
    Thank you so much .
    I didn't notice and interpret.
    OK, it works.

    Bažant

    20 Posts