xml3d-tools gives XML3D.URIResolver is undefined error

38 Views Asked by At

I began Working with xml3d.tools.js which seems quite not updated anymore. Actually the library fails at executing this part :

oldRefNode = XML3D.URIResolver.resolveLocal(oldRef);

TypeError: XML3D.URIResolver is undefined

  • xml3d.js Version is 5.2.1
  • xml3d-tools is dev snapshot 0.2.0

I have turned around but and cannot figure out in which namespace this class has gone. Maybe xml3d-tools is too much outdated ?

Is there any plan to replace the xml3d-tools.js ? I would really enjoy Gizmos and ability to drag models...

1

There are 1 best solutions below

1
On

Unfortunately the tools library isn't supported anymore. The original developer left the project some years ago and by now it would need a complete re-write to make it compatible with XML3D 5 and modern browsers.

If you want to have a go at creating a translation widget I think it can be done using the new web component support and the z-index property. It would probably work similar to the bounding box component example except you would insert it under the parent of the target element (ie. its parent <group>) so it sits in the same transformation hierarchy. Each arrow would have mouse listeners that translate the target element (along with the widget component itself) in the desired direction. Some of the mouse handling code can probably be pulled out of the tools library.

The z-index property can be used to ensure the arrows are always drawn above all other geometry. Even the scale of the widget itself can be adjusted according to the size of the bounding box of the target element (targetElement.getWorldBoundingBox().size()).