Navigation

    CreatiCode Scratch Forum

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

    Using Spheres

    3D Blocks
    1
    1
    593
    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 Boxes to a 3D scene

      Introduction

      Besides boxes, the next most commonly used shape in 3D scenes is the Sphere. Spheres can be added using the add sphere block from the 3D Object category:

       

      Parameters

      Color

      You can set the color of the sphere by clicking on the color input.

      Size in x/y/z

      These 3 numbers control the size of the sphere in each direction. For example, the following program adds an oval shape that is taller along the Z-axis:

       

      Arc

      The “arc” value allows us to show a portion of a sphere, just like how you can peel off some sections of an orange:

      For example, the following picture shows the difference between arc values of 100, 75, 50, 25 and 5:

       

      Slice

      The “slice” value allows us to vertically cut off a portion of a sphere, just like how you cut lemon slices:

      For example, the following picture shows the difference between slice values of 100, 75, 50, 25 and 5:

       

      Sides

      A sphere is approximated by many small triangles, and the “sides” value controls how many such triangles are used. The more sides, the smoother the sphere looks, but it would also take the game engine more time to draw these triangles. For example, the following picture shows the difference between sides values of 2, 4, 8, 16 and 32.

      For most situations, you can use sides of 8 or 16 to reduce the computations. If you are including a very large sphere in your scene, then you will need to use more sides to make it smooth.

       

      Demo

      When you set both the arc and slice to less than 100, you can get some interesting shapes.

      For example, with arc of 25 and slice of 50, you get a flying carpet:

      On the other hand, with arc of 50 and slice of 25, you get a face mask:

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