Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Resizing an Object

Resizing an Object

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

     

    Prerequisite

    • Adding Boxes to a 3D Scene
    • Loading an Avatar Into a Scene

     

    Description

    You can change the size of any object in the scene. Two methods will be introduced below.

     

    The “Update Scale” Block

    This block allows you to resize an object relative to its original size, either instantly or through an animation.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/52e32574-c030-4dfe-9ce1-b660908c6847.png" width="600" style="">

     

    Parameters

    • Scaling Percent: the ratio of the target size vs original size in each dimension. By default, 100% means the original size of the model. Note that the scaling is not relative to the current size. For example, if you scale the “X size” to 200%, then the object will double its width. But if you try to scale its X size to 200% again, nothing will change, since the object’s X size is already scaled to 200%.

    • Animation Time Period: By default the change in size happens instantly. However, if you specify a time period like 2 seconds, then the object will gradually change its scale in an animation during those 2 seconds.

    • Blocking or Not: when the animation time is more than 0 seconds, if we are in the “Blocking” mode, then blocks attached below this block will not run until the end of the animation time period. In the “Non-Blocking” mode, the blocks below will start running right away.

     

    Demo

    Here is a simple program that simulates a “heart-beat” kind of animation by repeatedly scaling the box larger then smaller:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/253cdb4d-9c73-4883-823c-51ed0540978e.gif" width="400" style="border-radius: 5px; border: 1px solid #29622d;">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b9d4e52f-277a-43f2-9cc1-0060556115f8.png" width="660" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

     

    The “Update Size” Block

    If you want to update an object to a specific size directly, you can use this block.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/d45fb21c-0500-4b45-8ebc-a7c5b2e1b2ba.png" width="350" style="">

    Note that you can leave one or two of the 3 input fields as empty. For example, if the x and y size inputs are empty, and the z size is not, then the object will be scaled so that its Z size matches with the input, and the other 2 dimensions will be scaled at the same ratio.

     

    Demo

    In this example, we have an avatar that is 100 units tall. Suppose we need to double his height to 200, we can set the target Z size to 200, and leave the X and Y inputs empty. Then the avatar will be scaled up proportionally.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/dbe810b9-0558-49f5-8526-a60a112529c1.gif" width="946" style="border-radius: 5px; border: 1px solid #29622d;">

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode