You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a VRML97 file that internally refers to a png via a relative URL. When I use a URL to that VRML97 file as the src attribute, the png loads fine. When I fetch the text and feed it to the browser via createX3DFromString, it can no longer find the png. Is there any way to control the resolution of relative URLs when I load content this way, or do I just have to be sure to replace any relative URLs in the string with absolute URLs before I pass it to createX3DFromString? (The point of fetching and then parsing is to do some preprocessing on the VRML97 code before rendering it.) Thanks for any guidance.
The text was updated successfully, but these errors were encountered:
Relative URLs are always resolved against the URL of the current execution context, i.e. the surrounding scene. If you have a Script node, and within this Script node you load a scene via createX3DFromString, all relative URLs are resolved against the URL of the scene to which the Script node belongs.
If you are using the external browser, i.e. within a HTML script element, you can use the baseURL property to control this behavior:
I have a VRML97 file that internally refers to a png via a relative URL. When I use a URL to that VRML97 file as the
src
attribute, the png loads fine. When I fetch the text and feed it to the browser via createX3DFromString, it can no longer find the png. Is there any way to control the resolution of relative URLs when I load content this way, or do I just have to be sure to replace any relative URLs in the string with absolute URLs before I pass it to createX3DFromString? (The point of fetching and then parsing is to do some preprocessing on the VRML97 code before rendering it.) Thanks for any guidance.The text was updated successfully, but these errors were encountered: