<?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[3D Coordinates and Positions]]></title><description><![CDATA[<p dir="auto"> </p>
<h2><a class="anchor-offset" name="prerequisite"></a>Prerequisite</h2>
<ul>
<li><a href="/topic/14/adding-boxes-to-a-3d-scene">Adding Boxes to a 3D scene</a></li>
</ul>
<h2><a class="anchor-offset" name="introduction"></a>Introduction</h2>
<p dir="auto">By default, all objects we add to the 3D world are positioned at the center of the world - the “<strong>origin</strong>” point. To move an object to a different position, we need to use “<strong>coordinates</strong>”.</p>
<p dir="auto">In <strong>1-dimensional worlds</strong>, everything is positioned along a very long arrow - the <strong>X-Axis</strong>. So if a point is at <strong>x of 50</strong>, we go 50 steps from the origin of the arrow along its direction to find that point. If a point is at <strong>x of -30</strong>, we start from the origin and go against the x-direction for 30 steps to find that point.</p>
<p dir="auto">ccimg3||700||,</p>
<p dir="auto"> <br />
In <strong>2-dimensional worlds</strong>, we use 2 coordinate numbers to represent the position of a point. For example, if a point is at <strong>x position of 50 and y position of -30</strong>, we find those 2 points in the X and Y directions, then <strong>find the point that is aligned to both of them</strong>.</p>
<p dir="auto">ccimg3||525||,</p>
<p dir="auto"> <br />
In <strong>3-dimensional worlds</strong>, we use 3 coordinate numbers. For example, if a point is at <strong>x of 50, y of 30, and z of 40</strong>, <strong>we first find those 3 points along each direction arrow, then find the point that is aligned to all 3 of them</strong>:</p>
<p dir="auto">ccimg3||800||,</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="using-motion-blocks-to-set-3d-positions"></a>Using Motion Blocks to Set 3D Positions</h2>
<p dir="auto">The good news is that these motion blocks work in 3D projects as well:</p>
<p dir="auto">ccimg3||700||,</p>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="strong-demo-strong"></a><strong>Demo</strong></h3>
<p dir="auto">For example, suppose we have added a yellow box to an empty scene. Its position will be at the origin. Note that this means the <strong>center point of the box</strong>, as indicated by the red dot, is at x of 0, y of 0, and z of 0.</p>
<p dir="auto">When we set the x position of the box to 100, its center point will be shifted along the X direction by 100 steps instantly. The other blocks work in a similar way as in 2D projects.</p>
<p dir="auto">ccimg3||725||,</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="the-move-to-x-y-z-block"></a>The Move to X/Y/Z Block</h2>
<p dir="auto">There is also a new block for moving to a 3D position:</p>
<p dir="auto">ccimg3||800||,</p>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="parameters"></a>Parameters</h3>
<ul>
<li>
<p dir="auto"><strong>Seconds</strong>: When this input is more than 0, the object will glide towards the 3D position over that number of seconds as an animation.</p>
</li>
<li>
<p dir="auto"><strong>Blocking Type</strong>: If “Blocking”, then the program will keep running this block until it completes; if “Non-Blocking”, then the program will continue to run the next block below this block right away. This is useful when you want to keep moving an object in a long animation, but also run the code below right away.</p>
</li>
</ul>
<p dir="auto"> </p>
<h3><a class="anchor-offset" name="demo"></a>Demo</h3>
<p dir="auto">Here is a simple example of moving a box through a 3-second animation.</p>
<p dir="auto">ccimg||800||,</p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="using-the-position-gizmo"></a>Using the “Position” Gizmo</h2>
<p dir="auto">Sometimes you know where you want to move an object to, but it is not easy to figure out the exact position numbers to use. You can use the <strong>position gizmo</strong> to help you.</p>
<p dir="auto">As shown, you can turn on or off the position gizmo by clicking the small button with 4 arrows on it. <strong>When the tool is enabled, you can click on the object you want to move, and you should see 3 small arrows centered at that object</strong>. When your pointer hovers over an arrow, <strong>it will be highlighted in yellow</strong>, and then you can drag it to move the object.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/4982831a-9da3-466b-ba48-c6849195939c.gif" width="500" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto">As you drag an object, observe that <strong>the x/y/z position values in the sprite pane will change accordingly</strong>. In addition, <strong>the position values in the motion blocks in the flyout will also change</strong>, so you can readily use them when you are done with dragging the object.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/2e24604a-702f-4966-a74d-c82e3622dac5.gif" width="1000" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="the-last-object-added-rule"></a>The “Last Object Added” Rule</h2>
<p dir="auto">Very often, we have more than one object in a scene. When we use the “move to” block, <strong>the object that was added right before this block would be moved</strong>.</p>
<p dir="auto">For example, in this program, the first move-to block would move the red box to X of 200, since <strong>that red box is the last object added to the scene before the first move-to block</strong>. However, the second move-to block would move the blue box instead.</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/29e40455-7b4a-46a5-983f-1f99e32a21e3.png" width="700" style="filter:drop-shadow(0.35rem 0.35rem 0.4rem rgba(0, 0, 0, 0.5))" /></p>
<p dir="auto"> <br />
This is what we get as a result:</p>
<p dir="auto"><img src="https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/38a4f112-bfbc-48eb-852a-0026a734f4b1.gif" width="450" style="border-radius:5px;border:1px solid #29622d" /></p>
<p dir="auto"> </p>
<h2><a class="anchor-offset" name="learn-more"></a>Learn More</h2>
<ul>
<li><a href="/topic/35/speed-of-3d-objects">Speed of 3D Objects</a></li>
</ul>
]]></description><link>https://forum.creaticode.com/topic/20/3d-coordinates-and-positions</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 19:46:23 GMT</lastBuildDate><atom:link href="https://forum.creaticode.com/topic/20.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Jan 2022 14:56:13 GMT</pubDate><ttl>60</ttl></channel></rss>