Closed DoomTay closed 4 years ago
Yes, this feature is not supported. Maybe we should rename the issue to "VRMLLoader: Support Text Nodes" or something like that. Besides, the semantic of size
is different when it's used inside fontStyle
.
It seems that VRMLLoader fails to support a few things besides V1. I couldn't get it working with this or this, which is gzipped, or this NIST-developed one
It's a shame, because I was hoping to use this as the backbone for a Firefox addon that allows for VRML navigation, saving me the work of having to research and write my own thing
VrmParser does not yet support Text, but I'm happy to address the issue following #13402.
@DoomTay would you mind to file an issue at the VrmlParser project? https://github.com/bartmcleod/VrmlParser I am looking into it. The first hurdle with Ver21.wrl seems to be that Switch is not yet supported or even parsed correctly.[Edit]Switch is supported. Must be something else.
[edit] Interesting, there were two issues with the file and my parser:
@DoomTay your example files seem to be full blown games with a lot of interaction, some of which might be supported by the current implementation of VrmlParser. Some of it is not, such as the Script node and route arrays. To be able to fully render these examples using VrmlParser is an interesting and ambituous goal. The challenge we could be facing here extends well beyond supporting the Text node.
I had a go on implementing TextNode
in VRMLLoader
today. Unfortunately, without success^^. This part of the VRML spec is really hard to map on today's Web APIs. You have to draw the text on a canvas element and then use it as a texture for a plane geometry. However, the sizing of the canvas as well as the correct application of VRML font style definitions when drawing the text is very complex.
TBH, the amount of code which is necessary to implement full support (or at least a decent one) seems to outweigh the benefits of text nodes.
@Mugen87 The text node has already (limited) support in the vrmlparser project. The VRMLLoader in Three is just an example of how VRML could be used in Three, but actual development effort in this field should go to the vrmlparser project, as this offers better separation of nodes. This makes it easier to add support one node at a time and to improve upon nodes when new ideas come up. It is also fully aware of the VRML node tree, which should make it possible to treat text in more advanced ways. We would however need someone with deep knowledge of fonts to be able to make a viable modern implementation.
It is also fully aware of the VRML node tree, which should make it possible to treat text in more advanced ways.
VRMLLoader
was rewritten last year. This works now in the loader, too.
Anyway, I'm fine with advising users to use your vrmlparser project if they need to work with TextNode
for some reasons.
VRMLLoader was rewritten last year. This works now in the loader, too.
I wasn't aware of this. I have been very busy doing other stuff. It is kinda sad that apparently the two projects diverged in such way that rewrites in one do not benefit the other.
I think we have discussed this before but VRMLLoader
should behave like other three.js
loaders and just parse geometries and materials. It's not its task to parse the whole application that a VRML asset might represent (including script logic, sensors etc.).
Against this backdrop, it's totally okay when different projects have different focus areas.
We did discuss it before and the projects do have different focus areas. However, I think they could share more than they do now. I have separated out the treatment of animation logic and sensors following that discussion, but I do not know in how far this contributed to the development of the loader VRMLLoader
a year ago, if at all. That would mean duplicated effort I'm affraid.
Description of the problem
Here is one such example of a text node with a "size" field containing only one number.
Three.js version
Browser
OS