Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-8940

[fiware-stackoverflow] XML3D getLocalBoundingBox gives "this.renderNode.getObjectSpaceBoundingBox is not a function" Error

    Details

      Description

      Created question in FIWARE Q/A platform on 19-11-2016 at 22:11
      Please, ANSWER this question AT https://stackoverflow.com/questions/40698190/xml3d-getlocalboundingbox-gives-this-rendernode-getobjectspaceboundingbox-is-no

      Question:
      XML3D getLocalBoundingBox gives "this.renderNode.getObjectSpaceBoundingBox is not a function" Error

      Description:
      This is quite hard to understand, I am working with current xml3D.js version 5.2.

      I am plaing with *BoundingBox() functions to ease the positioning of assets & cameras. Contents are properly loaded, The error appears unsing an xml3D assets file. It there anything specific to the xml3D assets ?.

      The xml3D contents

      Following is derived from https://github.com/xml3d/xml3d.js/wiki/Using-Assets-and-Models

      <body>
      <xml3d class="xml3d" view="#defaultView">
      <defs>
      <!-- camera position -->
      <transform id="t_camera" translation="0 0 40" rotation="0 1 0 0"></transform>
      <transform id="m_transform" scale="0.1 0.1 0.1"></transform>
      <transform id="t_Lamp" translation="0 0 -400"></transform>
      <transform id="r_Lamp" rotation="1 0 0 -0.2"></transform>

      <!-- permanent light -->
      <lightshader id="ls_directional" script="urn:xml3d:lightshader:directional">
      <float3 name="intensity">0.6 0.6 0.6</float3>
      </lightshader>
      <transform id="t_directional" rotation="1 0 0 -0.2" />
      <!-- //permanent light -->
      </defs>

      <!-- Our viewpoint from where we see the 3D content -->
      <group id="viewGroup" transform="#t_camera">
      <view id="defaultView"></view>
      </group>

      <!-- permanent light -->
      <group transform="#t_directional">
      <light shader="#ls_directional"></light>
      </group>
      <!-- //permanent light -->

      <!-- our model include -->
      <group transform="#m_transform">
      <model id="xmlmodel" src="ciccio.xml#ciccio"></model>
      </group>
      </xml3d>
      </body>
      <script>
      // attach event to the mesh
      document.querySelector("#xmlmodel").addEventListener("click", function()

      { var model = document.getElementById("xmlmodel"); alert("my center is " + model.getLocalBoundingBox().center().toDOMString()); }

      );
      </script>

      So when I click on the model, it runs the specified call to getLocalBoundingBox() and throws the error :

      getLocalBoundingBox — xml3d.js:15685TypeError:
      this.renderNode.getObjectSpaceBoundingBox is not a function. (In
      'this.renderNode.getObjectSpaceBoundingBox(bbox)',
      'this.renderNode.getObjectSpaceBoundingBox' is undefined)

        Activity

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        fla Fernando Lopez made changes -
        HD-Enabler XML3D [ 10903 ]
        Description
        Created question in FIWARE Q/A platform on 19-11-2016 at 22:11
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/40698190/xml3d-getlocalboundingbox-gives-this-rendernode-getobjectspaceboundingbox-is-no


        +Question:+
        XML3D getLocalBoundingBox gives &quot;this.renderNode.getObjectSpaceBoundingBox is not a function&quot; Error

        +Description:+
        This is quite hard to understand, I am working with current xml3D.js version 5.2.

        I am plaing with *BoundingBox() functions to ease the positioning of assets &amp; cameras. Contents are properly loaded, The error appears unsing an xml3D assets file. It there anything specific to the xml3D assets ?.

        The xml3D contents

        Following is derived from https://github.com/xml3d/xml3d.js/wiki/Using-Assets-and-Models

        &lt;body&gt;
        &lt;xml3d class="xml3d" view="#defaultView"&gt;
            &lt;defs&gt;
              &lt;!-- camera position --&gt;
              &lt;transform id="t_camera" translation="0 0 40" rotation="0 1 0 0"&gt;&lt;/transform&gt;
              &lt;transform id="m_transform" scale="0.1 0.1 0.1"&gt;&lt;/transform&gt;
              &lt;transform id="t_Lamp" translation="0 0 -400"&gt;&lt;/transform&gt;
              &lt;transform id="r_Lamp" rotation="1 0 0 -0.2"&gt;&lt;/transform&gt;

              &lt;!-- permanent light --&gt;
              &lt;lightshader id="ls_directional" script="urn:xml3d:lightshader:directional"&gt;
                  &lt;float3 name="intensity"&gt;0.6 0.6 0.6&lt;/float3&gt;
              &lt;/lightshader&gt;
              &lt;transform id="t_directional" rotation="1 0 0 -0.2" /&gt;
              &lt;!-- //permanent light --&gt;
            &lt;/defs&gt;

            &lt;!-- Our viewpoint from where we see the 3D content --&gt;
            &lt;group id="viewGroup" transform="#t_camera"&gt;
                &lt;view id="defaultView"&gt;&lt;/view&gt;
            &lt;/group&gt;

            &lt;!-- permanent light --&gt;
            &lt;group transform="#t_directional"&gt;
                &lt;light shader="#ls_directional"&gt;&lt;/light&gt;
            &lt;/group&gt;
            &lt;!-- //permanent light --&gt;

             &lt;!-- our model include --&gt;
            &lt;group transform="#m_transform"&gt;
             &lt;model id="xmlmodel" src="ciccio.xml#ciccio"&gt;&lt;/model&gt;
            &lt;/group&gt;
        &lt;/xml3d&gt;
        &lt;/body&gt;
        &lt;script&gt;
          // attach event to the mesh
        document.querySelector("#xmlmodel").addEventListener("click", function() {
            var model = document.getElementById("xmlmodel");
            alert("my center is " + model.getLocalBoundingBox().center().toDOMString());
        });
        &lt;/script&gt;


        So when I click on the model, it runs the specified call to getLocalBoundingBox() and throws the error :


          getLocalBoundingBox — xml3d.js:15685TypeError:
          this.renderNode.getObjectSpaceBoundingBox is not a function. (In
          'this.renderNode.getObjectSpaceBoundingBox(bbox)',
          'this.renderNode.getObjectSpaceBoundingBox' is undefined)

        Created question in FIWARE Q/A platform on 19-11-2016 at 22:11
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/40698190/xml3d-getlocalboundingbox-gives-this-rendernode-getobjectspaceboundingbox-is-no


        +Question:+
        XML3D getLocalBoundingBox gives &quot;this.renderNode.getObjectSpaceBoundingBox is not a function&quot; Error

        +Description:+
        This is quite hard to understand, I am working with current xml3D.js version 5.2.

        I am plaing with *BoundingBox() functions to ease the positioning of assets &amp; cameras. Contents are properly loaded, The error appears unsing an xml3D assets file. It there anything specific to the xml3D assets ?.

        The xml3D contents

        Following is derived from https://github.com/xml3d/xml3d.js/wiki/Using-Assets-and-Models

        &lt;body&gt;
        &lt;xml3d class="xml3d" view="#defaultView"&gt;
            &lt;defs&gt;
              &lt;!-- camera position --&gt;
              &lt;transform id="t_camera" translation="0 0 40" rotation="0 1 0 0"&gt;&lt;/transform&gt;
              &lt;transform id="m_transform" scale="0.1 0.1 0.1"&gt;&lt;/transform&gt;
              &lt;transform id="t_Lamp" translation="0 0 -400"&gt;&lt;/transform&gt;
              &lt;transform id="r_Lamp" rotation="1 0 0 -0.2"&gt;&lt;/transform&gt;

              &lt;!-- permanent light --&gt;
              &lt;lightshader id="ls_directional" script="urn:xml3d:lightshader:directional"&gt;
                  &lt;float3 name="intensity"&gt;0.6 0.6 0.6&lt;/float3&gt;
              &lt;/lightshader&gt;
              &lt;transform id="t_directional" rotation="1 0 0 -0.2" /&gt;
              &lt;!-- //permanent light --&gt;
            &lt;/defs&gt;

            &lt;!-- Our viewpoint from where we see the 3D content --&gt;
            &lt;group id="viewGroup" transform="#t_camera"&gt;
                &lt;view id="defaultView"&gt;&lt;/view&gt;
            &lt;/group&gt;

            &lt;!-- permanent light --&gt;
            &lt;group transform="#t_directional"&gt;
                &lt;light shader="#ls_directional"&gt;&lt;/light&gt;
            &lt;/group&gt;
            &lt;!-- //permanent light --&gt;

             &lt;!-- our model include --&gt;
            &lt;group transform="#m_transform"&gt;
             &lt;model id="xmlmodel" src="ciccio.xml#ciccio"&gt;&lt;/model&gt;
            &lt;/group&gt;
        &lt;/xml3d&gt;
        &lt;/body&gt;
        &lt;script&gt;
          // attach event to the mesh
        document.querySelector("#xmlmodel").addEventListener("click", function() {
            var model = document.getElementById("xmlmodel");
            alert("my center is " + model.getLocalBoundingBox().center().toDOMString());
        });
        &lt;/script&gt;


        So when I click on the model, it runs the specified call to getLocalBoundingBox() and throws the error :


          getLocalBoundingBox — xml3d.js:15685TypeError:
          this.renderNode.getObjectSpaceBoundingBox is not a function. (In
          'this.renderNode.getObjectSpaceBoundingBox(bbox)',
          'this.renderNode.getObjectSpaceBoundingBox' is undefined)

        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status In Progress [ 3 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: