In my scene I have loaded a .gltf model and it is rendered just fine.. It has a .png texture that is rendered on the surface of the 3d model. Is it possible to swap the texture programmatically? I'm using aframe (a-asset-item and a-entity to load the gltf asset)
相关问题
- Rotating an Object properly around a pivot point g
- Loading texture from Web Worker in Three.js
- My object isn't reflects the light in Three.js
- Black background for three.js sprites with depthTe
- Export ThreeJS Geometry to JSON
相关文章
- Get size of Object3D in Three.js
- Change color of mesh using mouseover in three js
- THREE.Object3D.add: object not an instance of THRE
- Why do I need to define a precision value in webgl
- Check a face is upwards/downwards towards mouse di
- How to change one texture image of a 3d model(maya
- Why do my three.js examples not load properly?
- Converting screen point to point on equirectangula
Once you’ve loaded a model in A-Frame or three.js, it doesn’t matter much what format it was before1. For A-Frame, you can use JS to modify the model after it loads.
See docs on THREE.MeshStandardMaterial to learn what properties there are to edit, although this could vary depending on the model you’re loading.
1 One exception is the
tex.flipY=false
setting above — you'll (probably) only need that for glTF, where the UVs have a different orientation than the three.js default.