<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Initializing a 3D Scene]]></title><description><![CDATA[<p dir="auto">A 3D “scene” is similar to a 2D “stage” in Scratch. It is a pre-built <strong>3D virtual world</strong> 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.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9217269/pasted-from-clipboard.png" width="600" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="key-block-1"></a>Key Block 1</h2>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229014/pasted-from-clipboard.png" width="400" /></p>
<ul>
<li>
<p dir="auto"><strong>Scene Name</strong>: 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.</p>
</li>
<li>
<p dir="auto"><strong>Hidden Mode</strong>: 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 <strong>show 3D scene</strong> block described below.</p>
</li>
</ul>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="behavior"></a>Behavior</h2>
<p dir="auto">When running this block, the 3D scene’s data will be <strong>downloaded into your browser</strong>, <strong>converted into 3D objects</strong>, and then <strong>rendered on the stage window</strong>. Larger scenes, such as the “city” scene, will take longer to prepare compared to simpler scenes like the “grass land” scene.</p>
<p dir="auto">Program execution will pause at this block, and continue to the next block only after the scene is completely rendered.</p>
<p dir="auto">If the “Empty” scene is loaded, it will not contain any object, but it does contain <strong>a dark blue background, a 3D camera, and some sunlight</strong>.</p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="never-initialize-the-3d-scene-more-than-once"></a>Never initialize the 3D scene more than once</h2>
<p dir="auto">In almost all scenarios, <strong><span style="color:#f60404">you should only initialize the 3D scene once</span></strong>. 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.</p>
<p dir="auto"> <br />
 </p>
<h2><a class="anchor-offset" name="example"></a>Example</h2>
<p dir="auto"><strong>Program:</strong></p>
<p dir="auto"><img src="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))" /></p>
<p dir="auto"><strong>Output:</strong></p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9217319/grass1.gif" width="400" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="key-block-2"></a>Key Block 2</h2>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229208/pasted-from-clipboard.png" width="400" /></p>
<ul>
<li><strong>Visible Mode</strong>: If “yes”, then the 3D scene will become visible; if “no”, then the 3D scene will be hidden.</li>
</ul>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="behavior"></a>Behavior</h3>
<p dir="auto">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.</p>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="example"></a>Example</h3>
<p dir="auto"><strong>Program:</strong></p>
<p dir="auto"><img src="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))" /></p>
<p dir="auto"><strong>Output:</strong></p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9229212/hidden.gif" width="400" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"><strong>Run it yourself:</strong><br />
<a href="https://play.creaticode.com/projects/a288e7d0063ff84a45e66da5" target="_blank">https://play.creaticode.com/projects/a288e7d0063ff84a45e66da5</a><br /> <br />
<iframe src="https://play.creaticode.com/projects/a288e7d0063ff84a45e66da5/embed" width="485" height="402" allowfullscreen></iframe></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="demos"></a>Demos</h2>
<p dir="auto"> <br />
<strong>Build and run your first 3D program:</strong><br />
 <br />
<img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9158971/c4b.gif" width="1000" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> <br />
<strong>Change the size of the 3D window:</strong><br />
 <br />
<img src="https://cdncreaticodecom.b-cdn.net/awsuploads/947564/images/9158997/f22.gif" width="1000" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="see-also"></a>See Also</h2>
<p dir="auto"><a href="/topic/9/using-an-orbit-camera-for-3d-scene-navigation">Using an Orbit Camera for Scene Navigation</a></p>
]]></description><link>https://forum.creaticode.com/topic/5/initializing-a-3d-scene</link><generator>RSS for Node</generator><lastBuildDate>Fri, 08 May 2026 08:35:04 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/5.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 22 Dec 2021 06:55:34 GMT</pubDate><ttl>60</ttl></channel></rss>