Texture rotation

Software: Away3D 4.x

yyovchev, Newbie
Posted: 17 July 2012 12:45 PM   Total Posts: 29

Is there any tool for texture rotating or I should rotate it before applying the texture?

   

Richard Olsson, Administrator
Posted: 17 July 2012 01:34 PM   Total Posts: 1192   [ # 1 ]

Either rotate the texture, or rotate the UV coordinates. The UV coordinates can be rotated statically in your 3D modeling tool, or you can do it using the uvRotation property on SubMesh. In the latter case, you have to enable UV transformation on the material by setting animateUVs to true. For example:

myMesh.subMeshes[0].uvRotation Math.PI/2// radians
TextureMaterial(myMesh.material).animateUVs true
   

yyovchev, Newbie
Posted: 17 July 2012 02:03 PM   Total Posts: 29   [ # 2 ]

Thanks! That’s what I was looking for.

   

yyovchev, Newbie
Posted: 17 July 2012 11:28 PM   Total Posts: 29   [ # 3 ]

When I merge meshes rotation disappear. Can this problem be solved?

   

Richard Olsson, Administrator
Posted: 18 July 2012 08:09 AM   Total Posts: 1192   [ # 4 ]

I don’t believe there is a way to get Merge to bake the UV transform into the UVs. You’d have to do it yourself by iterating over your UV data vectors, putting the values into Point instances and transforming them using the uvTransform matrix transformPoint() method.

Or, you could of course just rotate the UVs in your modeling package if you don’t need it to be dynamic (i.e. if you don’t intend to animate it et c.)

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X