Scaling a CubeGeometry without scaling its repeating TextureMaterial

Software: Away3D 4.x

Greeper, Newbie
Posted: 25 April 2013 01:42 AM   Total Posts: 3

I am building a small 3D-application where the user can scale a cube, which has a TextureMaterial applied, to any size.
Its a wall with a wood-like texture. But when the wall is scaled, the texture is scaling with the size of the CubeGeometry. But i like the texture to keep its original dimensions and just repeat on the surface when the size of the cube is beeing changed.

My question is:
Is there a build in way in away3d 4 which i can use to prevent the texturematerial from being scaled with its mesh? - and how?
... or do i have to scale the material down, as the mesh is being scaled up and how would i do that?

The Code looks like this:

[Embed(source="assets/wood_texture_01.png")]
private var Texture_01:Class;
  
var 
texture1:Texture2DBase = new BitmapTexture(new Texture_01().bitmapData);
var 
cubeMaterial:TextureMaterial = new TextureMaterial(texture1truetruetrue);
var 
wall:CubeGeometry = new CubeGeometry(10010010);
var 
newMesh:Mesh = new Mesh(wallcubeMaterial); 


thanks for your help in advance

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X