Closed colorzircon closed 5 years ago
As a possible workaround, these files seem to open correctly in Blender and export with the same appearance using https://github.com/KhronosGroup/glTF-Blender-IO. I realize if you have a lot of files that may be too much work. Example:
As a possible workaround, these files seem to open correctly in Blender and export with the same appearance using https://github.com/KhronosGroup/glTF-Blender-IO. I realize if you have a lot of files that may be too much work. Example:
Thank you very much for your prompt response. It's really an efficient method. But I don't know if there a way to display .glb files on web, because I try to enable them to be viewed through the browser using PC, Phone or Pad.
You can definitely display the .glb
files on web, yes — http://gltf-viewer.donmccurdy.com/ is an example, using THREE.GLTFLoader.
You can definitely display the
.glb
files on web, yes — http://gltf-viewer.donmccurdy.com/ is an example, using THREE.GLTFLoader.
Thank you very much. The problem that has been bothering me for a long time has been solved.
Is there a way to batch convert .wrl to .glb in Blender?
Yes, but it would require a bit of scripting ... see https://blender.stackexchange.com/questions/34537/how-to-batch-convert-between-file-formats. I haven't done this for VRML before but in theory you can just change a couple lines depending on the format.
Thank you very much for your patience. I also look forward to using VRMLloader to display my .wrl file in future.
I've tested one of your VRML files (Cube.wrl
) today and found a couple of issue in VRMLLoader
:
ROUTE
so far (this produces a runtime error)IndexedLineSet
Transform{rotation 1 0 0 0.0 children[
. The loaders thinks it's an invalid quaternion format because it interprets this line as 1, 0, 0, 0, children
. The expected value would be 1, 0, 0, 0
.Solving all these issues is actually quite a lot of work^^
Also, Transform{rotation 1 0 0 0.0 children[
isn't malformed, it's valid VRML because commas between numbers are optional.
The commas are not the problem but the children[
after the four quaternion values (the loader thinks its a quaternion format with five values^^). But as you said, this is still valid VRML. The loader is just not able to parse it...
That said, even if the loader would be fixed, it's still a much better solution to load the assets as glTF
like @donmccurdy suggested.
@colorzircon : You could also try https://github.com/create3000/x_ite (understands VRML fully) or https://github.com/x3dom/x3dom (understands X3D) . But this should be discussed elsewhere.
Thank you all very much, my warm friends.
Up to now, there are three ways to display .wrl
files.
using THREE.GLTFLoader as @donmccurdy suggested.
using X3DOM.js. .wrl
file needs to be convert to html
.
Instantreality supplies an online encoding converter and also local PC software converter.
X_ITE can directly load .wrl
files without prior plugin installation.
Please use option one :innocent: . glTF
is faster to parse and produces smaller files compared to VRML
or X3D
. It is also the recommended 3D format of three.js
:
https://threejs.org/docs/#manual/en/introduction/Loading-3D-models
No one should directly load formats like VRML
, OBJ
or Collada
in 3D apps anymore.
Oh, it looks like you have been already aware of alternatives. Apologies for the noise.
Oh, it looks like you have been already aware of alternatives. Apologies for the noise.
Never mind! Thank you very much for your suggestion.
I'm a university teacher teaching Crystallography. I have built a lot of crystal models in .wrl format exported from WinXmorph and Krystalshaper, two software of crystal morphology drawing. These files can be opened correctly by many PC software.
Recently, I tried to share these models on web, so that my students could view them through the browser whatever using PC, Phone or Pad. These .wrl files are much simpler than house.wrl, however, cannot be loaded by VRMLLoader.
I will be very appreciated if you can help me to solve the problem. It's very significant for me and my students.
Attachment is several entire files for testing.
Look forward to your reply.
models for testing.zip