XML3D getLocalBoundingBox给出" this.renderNode.getObjectSpaceBoundingBox不是函数"错误

时间:2016-11-19 21:36:20

标签: javascript fiware xml3d

这很难理解,我正在使用当前的xml3D.js版本5.2。

我正在使用* BoundingBox()功能来简化资产的定位。相机。内容已正确加载,错误显示 xml3D资源文件。它有什么特定的xml3D资产?。

xml3D内容

以下内容源自https://github.com/xml3d/xml3d.js/wiki/Using-Assets-and-Models

[Warning] [blocked] The page at https://www.backyardbeertours.ca/tours--prices.html was not allowed to run insecure content from http://www3.dragndropbuilder.com/editor/libraries/fancybox/fancybox.css?1432850887. (tours--prices.html, line 37)

[Warning] [blocked] The page at https://www.backyardbeertours.ca/tours--prices.html was not allowed to run insecure content from http://fonts.googleapis.com/css?family=Droid+Sans:400,700. (tours--prices.html, line 39)

[Warning] [blocked] The page at https://www.backyardbeertours.ca/tours--prices.html was not allowed to run insecure content from http://fonts.googleapis.com/css?family=Oswald:400,300,700. (tours--prices.html, line 40)

[Warning] [blocked] The page at https://www.backyardbeertours.ca/tours--prices.html was not allowed to run insecure content from http://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic. (tours--prices.html, line 41)

[Error] Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “assets.www3.dragndropbuilder.com” which could put your confidential information at risk. (sites.css, line 0)
[Error] ReferenceError: Can't find variable: Prototype
  (anonymous function) (tours--prices.html:70)
  Global Code (tours--prices.html:73)
[Error] Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “assets.www3.dragndropbuilder.com” which could put your confidential information at risk. (main.js, line 0)

因此,当我单击模型时,它会运行指定的getLocalBoundingBox()调用并抛出错误:

  

getLocalBoundingBox - xml3d.js:15685TypeError:   this.renderNode.getObjectSpaceBoundingBox不是函数。 (在   ' this.renderNode.getObjectSpaceBoundingBox(BBOX)&#39 ;,   ' this.renderNode.getObjectSpaceBoundingBox'未定义)

1 个答案:

答案 0 :(得分:2)

很抱歉,您遇到了这个问题,在最近的更新中,似乎有一个错误。我已经修复了即将发布的5.2.2补丁并上传了预览版本供您试用:xml3d-5.2.2-min.js

如果你打算使用它来定位相机,你可能想要使用getWorldBoundingBox,因为本地边界框并没有考虑来自更高层的任何转换层次结构(例如您的<group transform="#m_transform">。因此,您可以获得模型本身的边界框,但它可能不在场景中的同一位置。