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. Highlighting Objects

Highlighting Objects

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 1.1k 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 Models

     

    Description

    Sometimes, you need to highlight an object in your scene to attract the user’s attention. A blurry border can be drawn around the object’s contour (outline), so it appears that the object is emitting some light around it. Note that these lights will not be drawn on the object itself, which makes sure we can still clearly view the original object.

    Here are 2 examples:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a22d2667-fce2-4269-a589-bb8cd5c25277.gif" width="400" style="border-radius: 5px; border: 1px solid #29622d;">

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/a44a1d5e-6c25-423e-92b0-dc5255bf3612.gif" width="400" style="border-radius: 5px; border: 1px solid #29622d;">

     
    To highlight an object, you need to take 2 steps:

    1. Create a highlight layer. You can think of a highlight layer as a 2D canvas for painting on top of the 3D world.
    2. Add that object to the highlight layer, so that the contour of that object will be drawn in the highlight layer.

     

    Create a Highlight Layer

     

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/23b2daff-e065-45d2-bc14-1a8209ca8559.png" width="500" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

     

    Blur Size

    This input controls how wide the highlight lines are. Usually you want to keep it no more than 5. When the blur size is large, it will take longer to draw. Here is a comparison:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/11e188bf-17cc-42e6-953a-9bb7c68d26d9.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Name

    The second input specifies the name of the highlight layer. If you are only going to use one layer, then you do not need to name it. If you have multiple layers (discussed below), you will need to name them to refer to them later.

     
     

    Add an Object to a Highlight Layer

     
    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4e5e3755-1154-4b48-a11b-39d4e05708d0.png" width="450" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    Color

    You can specify the color of the blurry contour. Note that you can specify different colors for meshes that are added to the same layer.

    Highlight Layer Name

    If there is only one highlight layer, you won’t need to specify its name here. If there are multiple highlight layers, this input allows you to specify which layer to add this object to.

     
     

    Remove an Object from a Highlight Layer

    After adding an object to a highlight layer, you can turn off its highlight by removing it from the highlight group, using this block:

    bcdb8344-dc0d-4202-a3ee-e0a584e57eca-image.png

     
    For the input, if there is only one highlight layer, you won’t need to specify its name here. If there are multiple highlight layers, this input allows you to specify which layer to remove this object from.

     
     

    Multiple Highlight Layers

    When multiple objects are added to the same highlight layer, if they overlap, then their contours are merged, as if they are one object. In other words, no highlights are drawn at their overlapping edges.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b5a2c365-622c-4476-8be6-44fd2e47dbdb.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

    Here is the program to achieve this result:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f527f4d7-595f-4b17-8a39-d7d2ef2277f7.png" width="780" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

     
    However, if you want each object to have a complete highlight around its own contour, you can create multiple highlight layers, and add each object to its own highlight layer.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/beb8ea70-e90f-45e4-ae33-e02b8e3d5bbc.gif" width="500" style="border-radius: 5px; border: 1px solid #29622d;">

    Here is the program to achieve this result:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/249f5fdf-cfc0-4cc1-a013-787badc0ae7e.png" width="780" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

     

    Highlighted objects will stand out

    When there are multiple objects in the scene, and some of them are highlighted. Then those highlighted objects will always “stand out” against those that are not highlighted. In other words, they will not be blocked behind the non-highlighted objects.

    For example, in this program, the green ball is highlighted, but the orange ball is not.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0da1ac48-3c61-4ff2-a913-f00cc28aa293.png" width="700" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    As a result, when we rotate the camera, even when the green ball is behind the orange ball, we can still see it entirely:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/13fd6818-fc68-4b15-8cab-80e846d4b164.gif" width="400" 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