Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

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

@nickelnext

Description

@nickelnext

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions