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

Opening an Obj File with material and Texture from base64 string #75

Open
nickelnext opened this issue Mar 25, 2021 · 0 comments
Open

Comments

@nickelnext
Copy link

nickelnext commented Mar 25, 2021

Hi

I'm using Vue/nuxts and when i load my static component everything works fine

<template>
<Scene>
  <Camera type="arcRotate" :radius="7.5" :beta="Math.PI / 3"></Camera>
  <HemisphericLight></HemisphericLight>
  <Asset src="https://www.babylonjs-playground.com/scenes/skull.babylon" :scaling="[0.02, 0.02, 0.02]" :position="[4, 0.5, 0]"></Asset>
  <Asset src="https://www.babylonjs-playground.com/scenes/Buggy/glTF/buggy.gltf" :scaling="[0.02, 0.02, 0.02]" :position="[1, 0, -1]" :rotation="[0, Math.PI / 2, 0]"></Asset>
  <Asset src="https://www.babylonjs-playground.com/scenes/StanfordBunny.obj" :scaling="[7.5, 7.5, 7.5]" :position="[-4, -0.25, -0.5]" :rotation="[0, Math.PI, 0]"></Asset>
  <Asset src="https://rawgit.com/saswata26/misc/master/base.stl" :scaling="[0.02, 0.02, 0.02]" :position="[-2, 0, -0.5]"></Asset>
</Scene>
</template>
<script>
export default {
    name: 'babylon-js',
    props: ['media'],
}
</script>

Now i would like to use my media props as such

media : { "obj": "base64-encoded-string", "mtl":"base64-encoded-string", "img":{"type":"jpg","payload":"base-64-encoded-string"}}

with mtl optional and img optional (the obj might be without material, or the material might not be having a texture.

How can I Ioad this info from my media object rather than from an url into my scene?

Thank you very much

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

No branches or pull requests

1 participant