vue-3d-model icon indicating copy to clipboard operation
vue-3d-model copied to clipboard

Including a grid with loaded assets (GridHelper)

Open giuliobrugnaro opened this issue 5 years ago • 2 comments

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!

giuliobrugnaro avatar Jul 15 '19 09:07 giuliobrugnaro

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 avatar Jul 16 '19 01:07 hujiulong

@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!

Capture

giuliobrugnaro avatar Nov 27 '19 15:11 giuliobrugnaro