DIMEDROLL wrote:
How to assign 2 materials to one 3d object?
Let me explain what I want to achieve.
I have an object which I want to be painted with stone texture. At some place of this object I would like to place some grass circles. I have stone and grass textures. However I don't want to manually create a mixed stone+grass texture. How do I do it programmatically?
I assume I'll need 2 sets of UV coordinates for each texture...
The easiest way to understand what to do would be to check out one of the included ".scene.xml" files of your models. Here is one example:
Code:
<Model name="person" geometry="models/person/person.geo">
<Joint name="Bip01" tx="0" ty="87.3667" tz="0" rx="-88.48">
(...)
</Joint>
<Mesh name="person_mediumpoly" material="models/person/person_body.material.xml" batchStart="0" batchCount="7188" vertRStart="0" vertREnd="1632">
<Mesh name="#person_mediumpoly" material="models/person/person_hair.material.xml" batchStart="7188" batchCount="246" vertRStart="1633" vertREnd="1705" />
</Mesh>
</Model>
At the bottom you see that this model contains two meshes. You can chose the material for each mesh individually.