Skip to content

Instantly share code, notes, and snippets.

@iwaken71
Created March 29, 2022 19:27
Show Gist options
  • Save iwaken71/0d6b42f2aa877fe04350261b01afc825 to your computer and use it in GitHub Desktop.
Save iwaken71/0d6b42f2aa877fe04350261b01afc825 to your computer and use it in GitHub Desktop.
<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