简体   繁体   English

在 THREE.js r115 中访问 Object3D 网格材质

[英]Access Object3D Mesh Material in THREE.js r115

I am used to alter Objects3Ds Materials in the THREE.js scene graph.我习惯于在 THREE.js 场景图中更改 Objects3Ds 材质。

Now i switched to typescript and have some troubles accessing Mesh Materials (after creation).现在我切换到 typescript 并且在访问网格材料时遇到了一些麻烦(创建后)。 The docs and types state that there is no Object3D.material没有 Object3D.material 的文档和类型 state

I also dont see the.material anywhere on the Object3D during runtime!在运行期间,我也没有在 Object3D 的任何地方看到 the.material!

To make it work with Typescript - can I just to cast it to Mesh?为了使它与 Typescript 一起使用 - 我可以将它投射到网格上吗? Or how do I access the Mesh from Object3D?或者我如何从 Object3D 访问网格?

The material is on the Mesh object, which is inherits Object3D.材质在Mesh object上,继承了Object3D。

Check the docs of Mesh here此处查看 Mesh 的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM