Created
March 29, 2022 19:27
-
-
Save iwaken71/0d6b42f2aa877fe04350261b01afc825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<canvas id="renderCanvas" ref="bjsCanvas"/> | |
</template> | |
<script> | |
import { ref, onMounted } from "@vue/runtime-core"; | |
import { createScene } from "../scenes/MyFirstScene"; | |
export default { | |
name: "BabylonScene", | |
setup() { | |
const bjsCanvas = ref(null); | |
onMounted(() => { | |
if (bjsCanvas.value) { | |
createScene(bjsCanvas.value); | |
} | |
}); | |
return { | |
bjsCanvas, | |
}; | |
}, | |
}; | |
</script> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
padding: 0; | |
width: 100vw; | |
height: 100vh; | |
} | |
#renderCanvas { | |
margin: 0; | |
padding: 0; | |
width: 960px; | |
height: 540px; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment