How to Realize: Cutscene: Newsletter which is turning and zoom in

  • #1, z mulewaSaturday, 15. January 2022, 18:00 hodinky 2 years ago
    Hello, i want to realize an cuscene with an newspaper rhat is started with a zoomed out and than turning and zoom in.
    Something simular like most of you know out of DOTT
    See also movie:
    How can i realize this?

    Bažant

    21 Posts


  • #2, z esmeraldaSunday, 16. January 2022, 11:09 hodinky 2 years ago
    I would probably make an animation in my graphics software and play that.

    There is also the shader tool kit that allows you to control a camera, so you could zoom in and rotate the camera. (but I have never tried to rotate the camera more than 360° at once, so I'm not sure it is possible)
    http://www.visionaire-studio.com/luadocs/#shadertoolkit

    Or you could use the :to() function to scale and rotate the object.
    Like so:  Objects["Newspaper"] :to(3000, {Scale = 3, Rotation = 62.9}, easeQuadOut)

    the number 3000 is the time for the transformation in milliseconds,
    Scale and Rotation are the attributes of the object that are to be changed. Scale = 1 would be the original scale, 2 = double ... Rotation = 0 would be no rotation. One full 360° turn is about 6.29. So 62.9 is turning 10 times. The number is not quite accurate, I got there by experimenting. I know there is a way to set the rotation to degrees, but I don't know how or how to do the mathematical conversion to a float correctly. I hope someone else here will jump in and give the correct number or the Lua command to use degrees.
    easeQuadOut is defining the curve how the easing shall happen (in this case quick start, getting slower at the end) https://easings.net/

    Edit: found it -> Rotation = math.rad(360)  is a full 360° rotation
    Objects["Newspaper"] :to(3000, {Scale = 3, Rotation = math.rad(3600)}, easeQuadOut)
    Would rotate the object 10 times and scale up 3 times in 3 seconds

    one more edit: Thinking about it, scaling up a small image will make your newspaper unreadalbe - so it would be better to first scale down your scene filling object at the beginning of the scene. For example to a tenth of the original size.
    Action called at the beginning of the scene:
    Execute script -> Objects["Newspaper"] :to(0, {Scale = 0.1})
    Pause 500 ms  -- to make sure the first scaling is done before the next transformation, can be shorter
    Execute script -> Objects["Newspaper"] :to(3000, {Scale = 1, Rotation = math.rad(3600)}, easeQuadOut)

    Zabiják klíčů

    525 Posts

  • #3, z mulewaSunday, 16. January 2022, 14:34 hodinky 2 years ago
    It is working,
    and it is extrem cool, thank you so much esmeralda.
    This makes me feeling so happy today!!!

    Bažant

    21 Posts

  • #4, z mulewaSunday, 16. January 2022, 19:11 hodinky 2 years ago
    One hint:
     when you want to execute the same scene several times it is nessesary to set back the Rotation to 0 before (see bold adaptation):

    Action called at the beginning of the scene:
    Execute script -> Objects["Newspaper"] :to(0, {Scale = 0.1, Rotation = math.rad(0)})
    Pause 500 ms -- to make sure the first scaling is done before the next transformation, can be shorter
    Execute script -> Objects["Newspaper"] :to(3000, {Scale = 1, Rotation = math.rad(3600)}, easeQuadOut)

    Bažant

    21 Posts