Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use VglObjLoader #941

Open
0xuhe opened this issue Jun 18, 2020 · 4 comments
Open

How to use VglObjLoader #941

0xuhe opened this issue Jun 18, 2020 · 4 comments
Labels

Comments

@0xuhe
Copy link

0xuhe commented Jun 18, 2020

My project structure as follow:
-- public
---- seahorse.obj
-- src
---- views
------ index.vue

The code in index.vue:

<template>
  <vgl-renderer scene="scene1" camera="cam">
    <vgl-scene name="scene1">
      <vgl-obj-loader src="/public/seahorse.obj" />
      <vgl-ambient-light intensity="0.5" />
      <vgl-directional-light
        position="1 1 1"
        intensity="0.5"
      />
    </vgl-scene>
    <vgl-perspective-camera
      name="cam"
      orbit-position="300 1 0.2"
      orbit-target="0 0 -300"
    />
  </vgl-renderer>
</template>

but the console reports errors:

vgl-obj-loader.js?4eb7:formatted:1340 Uncaught TypeError: this.payloadHandler.handlePayload is not a function
at k.processMessage (vgl-obj-loader.js?4eb7:formatted:1340)
at eval (vgl-obj-loader.js?4eb7:formatted:1333)

@h-ikeda
Copy link
Member

h-ikeda commented Jun 18, 2020

Did you generate the project with Vue CLI? If so, the path to files in public directory is /seahorse.obj, not /public/seahorse.obj.

Then you should see the object rendered, but the error in console still there...
It may be related mrdoob/three.js#18356 (comment)

@h-ikeda h-ikeda added the bug label Jun 18, 2020
@0xuhe
Copy link
Author

0xuhe commented Jun 18, 2020

It works, Thanks for your help~

@0xuhe 0xuhe closed this as completed Jun 18, 2020
@0xuhe
Copy link
Author

0xuhe commented Jun 18, 2020

It loads obj file, but the console still report the same error
20200618163959

@0xuhe 0xuhe reopened this Jun 18, 2020
@renaudham
Copy link

Hi
My own guess as a new user.
I think it's only on hot refresh, while in dev mode in VueJs.
If you reload all the page, I don't see it anymore, and apparenlty it's not an issue on build.

But i'm not sure, newbie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants