Texture scaling

Software: Away3D 4.x

FeffersHat, Newbie
Posted: 03 May 2012 01:55 PM   Total Posts: 21

Alright, so I’m using a 256x512 pixel texture but when I place it on my object, it spreads out the image and looks really ugly (see image below).

Picture

My code:

//mapheight = 80
//mapwidth = 80

Scene.view.scene.addChild(floor);
   
   
floor.geometry = new CubeGeometry();
   
   
floor.material = new TextureMaterial(new BitmapTexture(getFloorTexture()));
   
   
floor.scaleX mapWidth;
   
floor.scaleZ mapHeight;
   
floor.scaleY .1

It probably has something to do with the scaling. If so, how can I fix this?

Also, away3d only takes about half the texture image. :/

   

FeffersHat, Newbie
Posted: 04 May 2012 02:49 PM   Total Posts: 21   [ # 1 ]

Bump. :D

 

   

NAZ, Newbie
Posted: 04 May 2012 03:49 PM   Total Posts: 9   [ # 2 ]

I’m wondering exactly the same.

I’m using a ColorMaterial and assigning a NormalMap and event when the map it’s smaller than the actual Mesh (Cube in my case) it’s not scaled inside centered or repeated… it’s just spread around with no continuity over the faces.

Simple code.

For any size of the Geometry it does not seem to vary much.

mat = new ColorMaterial(Math.random() * 0xFFFFFF);
mat.lightPicker = _lightPicker;
mat.bothSides = true;
mat.normalMap = new BitmapTexture(new BitmapNormal3()) ;

nuBox = new Mesh(cGeom, mat);

Thanks you for any support!

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X