Closed VladimirIvan closed 5 years ago
Testing this in Julia and something seems to be wrong with the transforms:
Tried a different model (UR5) and a similar thing happens:
Fixed. THREEJS sneakily modifies the matrix during multiplication so an explicit copy was missing and messing up the transforms.
I can confirm that this also works for https://github.com/tkoolen/universal-robot-dae-jl. Thanks, @VladimirIvan!
I can also confirm this is working. Tested universal-robot-dae-jl
on https://github.com/JuliaRobotics/MeshCatMechanisms.jl/commit/398a8246ea3c1fde63e6dd20f394163d2581fb5f and https://github.com/rdeits/MeshCat.jl/commit/160933c0ae285384da15a9b653010f23046c137d with:
diff --git /deps/build.jl
-const meshcat_sha = "3122cecd5da022ad96bb0c8dc0f811a1bc492350"
-const meshcat_url = "https://github.com/rdeits/meshcat/archive/$meshcat_sha.zip"
+const meshcat_sha = "8e1afae6685e82e2e5c2a7607fa27a12575c5bde"
+const meshcat_url = "https://github.com/VladimirIvan/meshcat/archive/$meshcat_sha.zip"
This is excellent, thank you for the contribution! I'm sorry I've been slow to respond (ironically, all my open-source time has been sucked up by my preparations for JuliaCon), but I'll take a look at this right away.
Hm, I'm getting errors with a couple of the test scenes. Could you try opening test/meshfile_object_obj.html
in a browser and see if you get the same error? I'm seeing:
TypeError: sphere is undefined main.js line 601 > eval:5747:3
copy three.module.js:5347
intersectsObject three.module.js:5786
projectObject three.module.js:22421
projectObject three.module.js:22466
projectObject three.module.js:22466
projectObject three.module.js:22466
render three.module.js:22224
render index.js:769
animate index.js:778
animate index.js:775
Note that that file loads in the non-minified dist/main.js
, so you'll need to ensure your npm run build
is going so you get the up-to-date javascript sources.
The geometry wans't being extracted from the OBJ data structure the same way between _meshfile_object
and _meshfile_geometry
. Fixed now.
Also, turns out that mesh merging was also required for OBJ to collect all the mesh groups. We always used single group meshes so we never found out.
I also fixed the material/texture loading via the resources
parameter for DAE.
The OBJ test is failing to load the material but it doesn't throw errors/warning anymore.
Ok, merged! I also updated the OBJ object loading to preserve materials so that all of the tests now pass.
ExtensibleObjectLoader
now correctly produces aTHREE.Mesh
object for objects of type '_meshfile_object'.url
can now specify the file name of the mesh file for the '_meshfile_object'. All resources will be looked up relative to this url.This is an extension of #57 (excluding the security patches).