How to make effect for picture zoom in/out

hello Guys

How to make effect for a picture that can make zoom in/out effect video

like this ,
https://s3.amazonaws.com/pbblogassets/uploads/2017/05/Faux-Zolly-Warp_Dog_Forrest.gif

Answers

  • Bakari Mustafa
    Bakari Mustafa Posts: 178 🔥🔥🔥

    To create a zoom-in/out effect for a picture in Lens Studio, you can use the following steps:

    1. Import the picture you want to use into the Resources panel.
    2. Drag the picture onto the Scene panel to create a Screen Image object.
    3. In the Inspector panel, click on the "Add Component" button and add a "Transform" component to the Screen Image object.
    4. In the Transform component, set the "Scale" property to the desired starting zoom level. For example, if you want the picture to start at 100% zoom, you would set the Scale to (1, 1, 1).
    5. Create a new Script by clicking on the "Add New" button in the Resources panel, selecting "Script", and giving it a name.
    6. In the Script, use the "update" event to animate the zoom effect. For example, you could use code like this to zoom in on the picture over time:
    // Declare a variable to store the current zoom level
    var zoom = 1;
    
    // In the update event, increase the zoom level by a small amount for each frame
    function update(eventData) {
        zoom += 0.01;
        script.getTransform().setScale(new vec3(zoom, zoom, zoom));
    }