Coin texture

Software: Away3D 4.x

Tom74, Newbie
Posted: 05 May 2015 02:38 PM   Total Posts: 5

Trying to make 25c coin. Got texture with both sides (avers & reverse) side by side. But when I’m applying texture to mesh, it’s became the same image on the both sides.

var coinMaterial:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(DIFFUSE));
 
coinMaterial.animateUVs true;
 
var 
coin:Mesh = new Mesh(new CylinderGeometry(30030020501truetruetruetrue), coinMaterial);

coin.subMeshes[0].scaleU 0.5 

I can’t figured out how to make this stuff works right: half of texture on the front side, and half on the back side of cylinder?

   

Avatar
Fabrice Closier, Administrator
Posted: 05 May 2015 03:22 PM   Total Posts: 1265   [ # 1 ]

From your question, I assume you have a bitmap where 50% of map area is front of the coin, 50% for the other side. You multiply by uvs u’s by 0.5 to cover. The idea is good, but you do use cylinderGeometry and cylinder is not mapped this way. Easier way would be to use LatheClass to generate the thickness of the ring, where the mapping would be 0-1 on u and v. so you could add some material for the side. The front and back would be RegularPolygonGeometry. Where you would multiply by .5 and one would receive an offset position u of .5.
Both the Lathe resolution and RegularPolygon should be exact same for seamless fit. You of course will have to rotate one side 180 degrees along Y or X depending on your yup choice and once one side is rotated, offset its y or z, (again this depending on your yup choice).
Once the 3 elements are generated, use the Merge class to obtain a single mesh with 2 subGeometries, 2 materials.

   

Tom74, Newbie
Posted: 06 May 2015 03:08 PM   Total Posts: 5   [ # 2 ]

Thaks for the idea! I think, I’ll make 2 objects for front and back sides, then place it together, so it looks like solid coin. Then merge it into single mesh and texturize both sides separately. Should works I think smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X