aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.58k stars 3.93k forks source link

Docs: Add note in 'material' component or FAQ about texturing models #3133

Open donmccurdy opened 6 years ago

donmccurdy commented 6 years ago

Common questions we should probably cover somewhere:

  1. The material component doesn't work on loaded models, except for OBJ models that do not already have an MTL (material) file.
  2. It's usually better to texture in DCC software (e.g. Blender). (Link to tutorial?)
  3. If you do need to texture or re-color something on-the-fly, use three.js APIs like this:
el.addEventListener('model-loaded', function(event) {
  event.details.model.traverse(function(object) {
    if (object.isMesh) {
      object.material.foo = bar;
    }
  });
});

For documentation on THREE.Material and its subclasses, see: https://threejs.org/docs/#api/materials/Material

cwervo commented 6 years ago

I've seen the Blender community suggest this Youtube tutorial series a lot for beginners. Maybe, pertaining to texturing, docs should point people to the video about material nodes?

Also, @donmccurdy, a bug in your example above, event.details should be event.detail