Multiple UV/materials

Software: Away3D 3.x

Fossor, Newbie
Posted: 03 September 2011 03:30 PM   Total Posts: 21

Hi,
Can someone point me out how to apply 2 materials using 2 different uv maps on one mesh? I’ve got .3ds model that has 2 uv channels each for different part of the model (like head and body for a character). Each uv has it’s own material.
Is this supported in 3.6? Or should I split model/combine uvs?
Thanx.

   

Avatar
kurono, Sr. Member
Posted: 03 September 2011 03:42 PM   Total Posts: 103   [ # 1 ]

Try

(mesh.subMesh[i].material as BitmapMaterial) = new BitmapMaterial(...) 

, where mesh is whole model. i = [0, 1, ... , totalSubMeshes]

   

Fossor, Newbie
Posted: 03 September 2011 04:01 PM   Total Posts: 21   [ # 2 ]

thanx kurono,
so i do have to split model, cause now i have it in one piece?

   

Avatar
80prozent, Sr. Member
Posted: 03 September 2011 05:07 PM   Total Posts: 430   [ # 3 ]

hi

to assign more than one material to a mesh, you need a submesh (and subgeometry) for each material.
each submesh has its own vertex-, index-, and uv-buffer, so different submeshes with different uvs should be possible.

hope that helps

[edit:] argh….....didnt reat the software version youre on. my answer would be for away3d 4 (broomstick)

 Signature 

sorry…i hope my actionscript is better than my english…

   

Fossor, Newbie
Posted: 03 September 2011 05:28 PM   Total Posts: 21   [ # 4 ]

thank you 80prozent,
Still didn’t checked the broomstick, but anyway, different submeshes means different objects without shared vertexes and edges? If not, how can one separate mesh to submeshes?

   

Avatar
80prozent, Sr. Member
Posted: 03 September 2011 05:47 PM   Total Posts: 430   [ # 5 ]

sorry, cant tell you much about away3d before molehill smile

if i remember right, i didnt used different materials on one mesh in away3d 3.5.

 Signature 

sorry…i hope my actionscript is better than my english…

   

Fossor, Newbie
Posted: 03 September 2011 05:58 PM   Total Posts: 21   [ # 6 ]

And how this done with broomstick?

   

Avatar
80prozent, Sr. Member
Posted: 03 September 2011 06:22 PM   Total Posts: 430   [ # 7 ]

in molehill every meshs geometry data (vertex, index, and uv buffer)is descripted by a “geometry” object.

this is true for earlier away versions too.

in molehill every mesh and every geometry object can contain more than one submesh/subgeometry.

so you simply create a mesh and assign a geometry object to it.
than you create two (or more) subgeometry objects, update their buffers and make them child of the geometry object.
now you can apply a different material to each submesh inside your mesh object (the submeshes beeing created by away3d when applying the subgeometries to the geometry).

hope that make sense

 Signature 

sorry…i hope my actionscript is better than my english…

   

Fossor, Newbie
Posted: 03 September 2011 06:28 PM   Total Posts: 21   [ # 8 ]

Thanx man. Will check it.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X