vue-3d-model
vue-3d-model copied to clipboard
Including a grid with loaded assets (GridHelper)
I would like to display with each loaded asset also a grid of lines to provide some spatial reference. In three.js I have found a GridHelper (https://threejs.org/docs/#api/en/helpers/GridHelper ) which does exactly this. My question is: is there a way to include this as part of vue-3d-model with a bit of extra coding? If yes, could you indicate to me the direction to follow? It would be really helpful to be able to load extra functionalities and utilities from three js if needed. Thank you!
You can do it with some hacks, but there is no guarantee that future versions will still be able to do this.
<template>
<model-obj ref="model" src="static/models/obj/tree.obj"/>
</template>
<script>
import { ModelObj } from 'vue-3d-model'
import { GridHelper } from 'three';
export default {
components: {
ModelObj
},
mounted() {
this.$refs.model.scene.add(new GridHelper());
}
}
</script>
@hujiulong Thank you! I am loading the GridHelper
as you suggested but I am a bit confused by the result (please see below), any suggestions? Thank you!