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. Initializing a 3D Scene

Initializing a 3D Scene

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 5.5k Views 1 Watching
  • 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

    A 3D “scene” is similar to a 2D “stage” in Scratch. It is a pre-built 3D virtual world with some background, objects, lighting, and cameras, so you just need to add new objects/characters specific to your project into this world. For example, a “city” scene may contain buildings and roads.

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9217269/pasted-from-clipboard.png" width="600" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Key Block 1

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229014/pasted-from-clipboard.png" width="400" style="">

    • Scene Name: By default, an “Empty” scene will be loaded with no objects in it. You can select a different scene by clicking the “Empty” input field, which will pop up a library window for you to browse and select a new scene. All available scenes: Empty, Blue Sky, Castle, City, Classroom, Earth, Solar System, The Moon, Moon Surface, Mars Surface, Mars Geography Map, Mars Geography Map with Names, Garden, Globe, Earth Geography, Globe in Chinese, Globe in Chinese (more labels), Grass Land, House, School, Soccerfield, Street, Underwater, Village, Human Body, World Map, USA Map, Vietnam Map.

    • Hidden Mode: By default, the scene is visible when it is created. You can set it to be hidden instead by selecting “yes”. The scene will still be downloaded and constructed, but it will not be rendered in the stage window. To reveal the scene later, you can use the show 3D scene block described below.

     
     

    Behavior

    When running this block, the 3D scene’s data will be downloaded into your browser, converted into 3D objects, and then rendered on the stage window. Larger scenes, such as the “city” scene, will take longer to prepare compared to simpler scenes like the “grass land” scene.

    Program execution will pause at this block, and continue to the next block only after the scene is completely rendered.

    If the “Empty” scene is loaded, it will not contain any object, but it does contain a dark blue background, a 3D camera, and some sunlight.

     
     

    Never initialize the 3D scene more than once

    In almost all scenarios, you should only initialize the 3D scene once. For example, if you initialize the 3D scene 2 times, then the second time you do it, the existing 3D scene and all the objects in it will be removed.

     
     

    Example

    Program:

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9215433/blocks__13_.png" width="400" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    Output:

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9217319/grass1.gif" width="400" style="border-radius: 5px; border: 1px solid #29622d;">

     

    Key Block 2

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229208/pasted-from-clipboard.png" width="400" style="">

    • Visible Mode: If “yes”, then the 3D scene will become visible; if “no”, then the 3D scene will be hidden.

     

    Behavior

    When running this block, the 3D scene will become visible or hidden immediately. This is useful if you want to hide the 3D scene initially and reveal it later. You may also use this block to hide the 3D scene and display the 2D stage instead.

     

    Example

    Program:

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229210/code.png" width="400" style="filter: drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5));">

    Output:

    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229212/hidden.gif" width="400" style="border-radius: 5px; border: 1px solid #29622d;">

    Run it yourself:
    https://play.creaticode.com/projects/a288e7d0063ff84a45e66da5

     

    Demos

     
    Build and run your first 3D program:
     
    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9158971/c4b.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">

     
    Change the size of the 3D window:
     
    https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9158997/f22.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">

     

    See Also

    Using an Orbit Camera for Scene Navigation

    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