kovacsv / Online3DViewer

A solution to visualize and explore 3D models in your browser.
https://3dviewer.net
MIT License
2.31k stars 513 forks source link

Automatic initialization in Mediawiki site #431

Open inddigital-xtech opened 8 months ago

inddigital-xtech commented 8 months ago

Hi, I'm trying to implement the viewer as browser-ready bundle In my local mediawiki site, and the only way I have to add Javascript code is through Common.js

I have read and applied the installation and use procedure indicated in: https://kovacsv.github.io/Online3DViewer/index.html

The problem is that these two lines are not being recognized there:

OV.SetExternalLibLocation ('libs');
OV.Init3DViewerElements ();

I guess Common.js doesn't understand what the OV object is

Can you help me please, I really appreciate it.

GitHubDragonFly commented 8 months ago

Viktor will probably have a better answer for you but just in case if this might help here is how my Quick Viewer is using O3DV:

    <script src="https://cdn.jsdelivr.net/npm/online-3d-viewer@0.10.0/build/engine/o3dv.min.js"></script>
    <script>
      // Set the external libraries location
      OV.SetExternalLibLocation( 'https://cdn.jsdelivr.net/npm/online-3d-viewer@0.10.0/libs' );

      // Init all the 3d viewer elements.
      OV.Init3DViewerElements();
    </script>

There might be some limitations to my approach so consider this as a suggestion only.

inddigital-xtech commented 8 months ago

Thank you for your response, but I think the problem will persist because I don't see how to define the OV object, before referring to it in Common.css, I attach a screenshot of the browser console: imagen