can I use troisjs load external model like use threejs ? and how? tks
Do you mean loading a 3d model file (gltf or else) ?
It is possible to load external. I just look into while ago in how to do as the src code is easy to understand once look more of the examples.
Text2D.js or Text2D.mjs
import { defineComponent } from 'vue';
import { Object3D } from 'troisjs';
import { Text } from 'troika-three-text';
export default defineComponent({
name: 'Text2D',
extends: Object3D,
setup() {
const text2D = new Text();
text2D.text = 'Hello world!'
text2D.fontSize = 0.2
//text2D.position.z = -2
text2D.color = 0x9966FF
return {
text2D,
//group: new Group(),
//text2D: new Text(),
}
},
created() {
//this.initObject3D(this.group)
this.initObject3D(this.text2D)
},
//__hmrId: 'Group',
__hmrId: 'text2D',
})
Be sure to follow some vue defineComponent for use in extend class for object3D. But I didn't see the guide about it.
yes。 that i mean
---- 回复的原邮件 ---- | 发件人 | Kevin @.> | | 日期 | 2022年03月29日 04:21 | | 收件人 | @.> | | 抄送至 | @.@.> | | 主题 | Re: [troisjs/trois] can I use troisjs load external model like use threejs ? and how? tks (Issue #131) |
Do you mean loading a 3d model file (gltf or else) ?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>