Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Highlighting Objects

    3D Blocks
    1
    1
    396
    Loading More Posts
    • 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.
    • info-creaticode
      CreatiCode last edited by admin

       

      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:

       
      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

       

       

      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:

       

      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

       

      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.

      Here is the program to achieve this result:

       
      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.

      Here is the program to achieve this result:

       

      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.

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

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post