Changing texture coordinates at runtime

Software: Away3D 4.x

dominiksvensson, Newbie
Posted: 29 July 2012 08:16 PM   Total Posts: 1

Hey,

I am developing an application in Away3D 4.x. In this application, I will have a 3D model (an obj file model) and different materials for this model at different times (changing discretelly, not continuously). In each of these materials, the texture coordinate of the model should be different. Is it possible to implement a logic to handle that in Away3D? Or should I import several 3D models with the same geometry, but with different texture coordinates?

Best

   

Richard Olsson, Administrator
Posted: 29 July 2012 09:04 PM   Total Posts: 1192   [ # 1 ]

This depends on what you mean by “different”. If the texture coordinates are simply transformed linearly, i.e. by scaling, rotating and/or translating the UV space, then you can achieve it using UV transforms.

If the UV coordinates are actually completely different, as in unwrapped differently, you are best off loading several models. You could theoretically just change the UV buffer of a single Geometry, but it makes little sense given the extra effort included in getting that data into the engine (without loading full models, in which case you might as well use completely separate models in the first place.)

UV transformation happens on the SubMeshes of your Mesh, and you have to remember to set the animateUVs property to true on your material.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X