threeJS
troisJS
<Box>
<BasicMaterial color="0x00ff00" />
</Box>Focus on the script tag->
Hard to figure out object hierarchy at first glance!!!
<template>
<Renderer ref="rendererC" antialias resize="window">
<!-- content -->
</Renderer>
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
const rendererC = ref<RendererPublicInterface>();
onMounted(() => {
const renderer = rendererC.value;
renderer?.onBeforeRender(() => {
// do stuff in loop
});
});
</script><template>
<!-- content -->
</template>
<script setup lang="ts">
import { ref, onMounted, computed } from "vue";
const renderer = inject<RendererPublicInterface>(
RendererInjectionKey as symbol
);
onMounted(() => {
renderer?.onBeforeRender(() => {
// do stuff in loop
});
});
</script><- template ref
inject ->
UI overlay to display score and menu ->
our 3D content ->
->
Create # of Tetris board and player model base on # of players
My naive Tetris board implementation
TroisJS comes with `FbxModel` component which makes importing 3D model a breeze 💨
code from PlayerModel.vue
You will need to do a bit of threejs!
Text
on model load in->
load texture->
load animation->
move animation forward->
Questions???
Thoughts???
Thank you