Script: Ready Made Assets Loaded

Ready Made Assets Loaded picture
Type
Blockly logo indicatorblockly
Date Created
Dec 23, 2022, 9:43:42 PM
Last Edit Date
Feb 28, 2025, 4:12:15 PM

Project Information

Algorithms allow to create rules for large scale 3D structures. Composing such objects from small components makes building process easier. Discrete parts can be assembled more easily. This script illustrates the possibilities of our platform. We make use of professional geometry kernels. In the latest release we tuned performance for faster rendering of such objects.

View Full Project

Script Code

<xml xmlns="https://developers.google.com/blockly/xml">
 <variables>
  <variable id="YT|:=]2ouoQ|}Ien_hIT">grid</variable>
  <variable id="f2kBzNK}C5jz9(wH3:MO">drawnGLB</variable>
  <variable id=",U9d3R8WMk*_UX4QgjR0">timeElapsedFromPreviousFrame</variable>
 </variables>
 <block type="bitbybit.babylon.scene.useRightHandedSystem" id="|uvzC4|f8/#};OXQm|ah" x="-63" y="-371">
  <value name="Use">
   <block type="logic_boolean" id="sk;z?byT]=($VY#-$KGv">
    <field name="BOOL">TRUE</field>
   </block>
  </value>
  <next>
   <block type="bitbybit.babylon.scene.enableSkybox" id="5KB%TVA?z_Ii=Fl6=#tB">
    <value name="Skybox">
     <block type="bitbybit.babylon.enums.skyboxEnum" id="U`:~-KWz.^K.i=-YBH?6">
      <field name="bitbybit.babylon.enums.skyboxEnum">'clearSky'</field>
     </block>
    </value>
    <value name="Size">
     <block type="math_number" id="-}(dbpJ.`a:aa5Q4GA60">
      <field name="NUM">1000</field>
     </block>
    </value>
    <value name="Blur">
     <block type="math_number" id="FR1^XNu({vJIQ-gs}.0]">
      <field name="NUM">0.4</field>
     </block>
    </value>
    <value name="EnvironmentIntensity">
     <block type="math_number" id="e,jS`~AsH{m0uyWdXW0M">
      <field name="NUM">0.8</field>
     </block>
    </value>
    <next>
     <block type="variables_set" id="9PRI+C3z{w)wQubus{%n">
      <field name="VAR" id="YT|:=]2ouoQ|}Ien_hIT">grid</field>
      <value name="VALUE">
       <block type="bitbybit.draw.drawGridMesh" id="1uZ:aI)X=8kY)WiB9?v7">
        <value name="Width">
         <block type="math_number" id="[irhdem@^y2~yG3(_^F.">
          <field name="NUM">400</field>
         </block>
        </value>
        <value name="Height">
         <block type="math_number" id="+@g3#OdU1py8Hy}`#Mq_">
          <field name="NUM">400</field>
         </block>
        </value>
        <value name="Subdivisions">
         <block type="math_number" id="LMcZK5}g^PN.n/%|pd14">
          <field name="NUM">10</field>
         </block>
        </value>
        <value name="MajorUnitFrequency">
         <block type="math_number" id="a-hNlk$am)X?t!q(]!Kg">
          <field name="NUM">10</field>
         </block>
        </value>
        <value name="MinorUnitVisibility">
         <block type="math_number" id=",fs^KQ/zGB}`uMA/gk3Q">
          <field name="NUM">0.45</field>
         </block>
        </value>
        <value name="GridRatio">
         <block type="math_number" id=";#{k)T+1]C3[SjGWk|}:">
          <field name="NUM">0.5</field>
         </block>
        </value>
        <value name="Opacity">
         <block type="math_number" id=",PC.=F{}ilX$dg6cxL?Y">
          <field name="NUM">0.5</field>
         </block>
        </value>
        <value name="BackFaceCulling">
         <block type="logic_boolean" id="vJe[$?T7mtpt_)GV#gvJ">
          <field name="BOOL">TRUE</field>
         </block>
        </value>
        <value name="MainColor">
         <block type="colour_picker" id="cMnbmE5fau0iE1:YsgxP">
          <field name="COLOUR">#000000</field>
         </block>
        </value>
        <value name="SecondaryColor">
         <block type="colour_picker" id="SPlM}q=*M}zbbh}|[kj7">
          <field name="COLOUR">#000000</field>
         </block>
        </value>
       </block>
      </value>
      <next>
       <block type="bitbybit.babylon.scene.drawDirectionalLightNoReturn" id="LcD:z1(`uBbl$S]?SM=G">
        <value name="Direction">
         <block type="bitbybit.point.pointXYZ" id="SFaVO-NE2cPo_rW-ki7p">
          <value name="X">
           <block type="math_number" id="UYkvMh]{k=mtgv`1^u$h">
            <field name="NUM">-50</field>
           </block>
          </value>
          <value name="Y">
           <block type="math_number" id="3$5y`Ul2-$V8g,Lx.7aW">
            <field name="NUM">-100</field>
           </block>
          </value>
          <value name="Z">
           <block type="math_number" id="}BUV,*vIq:,$te2dY.Yj">
            <field name="NUM">-50</field>
           </block>
          </value>
         </block>
        </value>
        <value name="Intensity">
         <block type="math_number" id=";K@)_6WpCk6{^}{-/6Uf">
          <field name="NUM">4</field>
         </block>
        </value>
        <value name="Diffuse">
         <block type="colour_picker" id="uplR;7bb8H3:.j(n@c(q">
          <field name="COLOUR">#ffffff</field>
         </block>
        </value>
        <value name="Specular">
         <block type="colour_picker" id="ov)qG:yvCsC`Iu^$3l@m">
          <field name="COLOUR">#ffffff</field>
         </block>
        </value>
        <value name="ShadowGeneratorMapSize">
         <block type="math_number" id=")iC.!R*9H:?@Rh[2/F|W">
          <field name="NUM">3000</field>
         </block>
        </value>
        <value name="EnableShadows">
         <block type="logic_boolean" id=",@kiT8ID5!4?op,BFu.)">
          <field name="BOOL">TRUE</field>
         </block>
        </value>
        <value name="ShadowDarkness">
         <block type="math_number" id="3-mGTII;a,Qg+*=8_NZ_">
          <field name="NUM">0</field>
         </block>
        </value>
        <value name="ShadowUsePercentageCloserFiltering">
         <block type="logic_boolean" id="vTaTDXjBw~Uyz~[{M15Z">
          <field name="BOOL">TRUE</field>
         </block>
        </value>
        <value name="ShadowContactHardeningLightSizeUVRatio">
         <block type="math_number" id="L{puu~-;liQAcK+f5MF^">
          <field name="NUM">0.2</field>
         </block>
        </value>
        <value name="ShadowBias">
         <block type="math_number" id="Z3NaZ`C8qlRuOh{]Xi}S">
          <field name="NUM">0.0001</field>
         </block>
        </value>
        <value name="ShadowNormalBias">
         <block type="math_number" id="ZX}VqW5elfjAub}THtSl">
          <field name="NUM">0.002</field>
         </block>
        </value>
        <value name="ShadowMaxZ">
         <block type="math_number" id="@:R`~2{`}R9{OmleEE}H">
          <field name="NUM">1000</field>
         </block>
        </value>
        <value name="ShadowMinZ">
         <block type="math_number" id="S)a.2wJ`oz;KPb5APgej">
          <field name="NUM">0</field>
         </block>
        </value>
        <next>
         <block type="base_time_async_context" id=",e!vRLNz7!2`udY}s*(9">
          <statement name="Then">
           <block type="variables_set" id="3Fgh#n8%!-[h7L8,400l">
            <field name="VAR" id="f2kBzNK}C5jz9(wH3:MO">drawnGLB</field>
            <value name="VALUE">
             <block type="base_time_await_return" id="h-w0wOD?;KP;*?e.sj{T">
              <value name="Promise">
               <block type="bitbybit.babylon.io.loadAssetIntoScene" id="a@#1,utb;o[zPx5Ys8PW">
                <value name="AssetFile">
                 <block type="bitbybit.asset.getFile" id="w^EUq)K_3{Rm4!`KJ`j8">
                  <value name="FileName">
                   <block type="text" id="I4^A[kxYsH/cTU)t4JY|">
                    <field name="TEXT">parametric-roof.glb</field>
                   </block>
                  </value>
                 </block>
                </value>
               </block>
              </value>
             </block>
            </value>
            <next>
             <block type="base_time_update" id="~m-^GNsY.c8ixYbi}_*,">
              <field name="TimePassedMs" id=",U9d3R8WMk*_UX4QgjR0">timeElapsedFromPreviousFrame</field>
              <statement name="Update">
               <block type="bitbybit.babylon.mesh.yaw" id="=q,rjeCpkAqKqmIU,;9{">
                <value name="BabylonMesh">
                 <block type="variables_get" id="jF(`c|MV@Sb*AXMqRh0u">
                  <field name="VAR" id="f2kBzNK}C5jz9(wH3:MO">drawnGLB</field>
                 </block>
                </value>
                <value name="Rotate">
                 <block type="math_number" id="k5sW9.i(qn`nsRV;0d{P">
                  <field name="NUM">0.03</field>
                 </block>
                </value>
                <next>
                 <block type="bitbybit.babylon.mesh.yaw" id="c*9w[Hw:*bFyqzk;SF]@">
                  <value name="BabylonMesh">
                   <block type="variables_get" id="cOM@8m.%TX;$?=T^,Y~7">
                    <field name="VAR" id="YT|:=]2ouoQ|}Ien_hIT">grid</field>
                   </block>
                  </value>
                  <value name="Rotate">
                   <block type="math_number" id="7[fAI1IzvYnNX1Bp)Wdt">
                    <field name="NUM">0.03</field>
                   </block>
                  </value>
                 </block>
                </next>
               </block>
              </statement>
             </block>
            </next>
           </block>
          </statement>
         </block>
        </next>
       </block>
      </next>
     </block>
    </next>
   </block>
  </next>
 </block>
</xml>