vue-babylonjs
vue-babylonjs copied to clipboard
Opening an Obj File with material and Texture from base64 string
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