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

[Question] How can use the CanvasTexture? #866

Open
juancrobles opened this issue Mar 17, 2020 · 1 comment
Open

[Question] How can use the CanvasTexture? #866

juancrobles opened this issue Mar 17, 2020 · 1 comment

Comments

@juancrobles
Copy link

Hi, I am working in a vue app which need render a 3d object with a custom texture; in this tutorial the three js use CanvasTexture component, so my question is how can be used in the vue-gl?

@h-ikeda
Copy link
Member

h-ikeda commented Mar 18, 2020

I didn't know such way to use custom textures.

One way to achieve this may be overriding VglTexture's computed property on a new component like below.

const VglCanvasTexture = {
  mixins: [VglTexture],
  computed: {
    inst() {
      return new CanvasTexture(yourCanvasElement);
    },
  },
};

The canvas to become a custom texture have to be created and rendered manually, I guess.

But I haven't test this code. Just an idea.

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

No branches or pull requests

2 participants