We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

How to use puzzles and ES6 together

Home Forums Programming How to use puzzles and ES6 together

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #85128
    omeletee
    Customer

    Hello

    I want to try out these examples and keep the puzzles, but they all use ES6 syntax.

     
     <script src="v3d.js"></script>
      <script src="addons/EffectComposer.js"></script>
      <script src="addons/OutlinePass.js"></script>
      <script src="addons/RenderPass.js"></script>
      <script src="my_awesome_app.js"></script>
    

    This won’t work because they both use “import”.

    How can I make them compatible?

    Thank you for your attention

    • This topic was modified 2 days, 7 hours ago by omeletee.
    • This topic was modified 2 days, 7 hours ago by omeletee.
    #85133

    Hi,

    Unfortunately the Three.js examples are outdated and no longer supported in Verge3D. You should take newer ones directly from the upstream and port manually.

    The good thing, is that many nice features are already ported to v3d.js runtime or Puzzles. For example, all 3 addon modules used in your snippet has been integrated in the Verge3D core long ago.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #85134
    omeletee
    Customer

    Thank you for your work.

    I noticed the functionality in Puzzle, but it doesn’t allow for adjusting the outline, whereas the Three.js component does.

    Is there a way to use ES6 syntax?

    I tried using v3d.module.js from npm
    , and it seems to work. Is this the correct approach?

    Thanks again for your reply

    • This reply was modified 1 day, 10 hours ago by omeletee.
    #85138

    Sure you can replace v3d.js by v3d.module.js in your application! However, this setup should be maintained manually (e.g. you should not update your app with the automatic update feature).

    Soft8Soft Tech Chief
    X | FB | LinkedIn

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.