Try to apply SkyBoxMaterial to Cube, but UV map error

Software: Away3D 4.x

Neugls, Newbie
Posted: 04 July 2012 07:50 AM   Total Posts: 5

I am trying to build a cube with Away3D 4. I need to manager material on each side of the cube, so, I trying to apply the SkyBoxMaterial to the Mesh with this code :

var w:Number 580h:Number 580d:Number 580;
   
   var 
pageTexture1:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/11.swf"null11512512nullfalse); 
   var 
pageTexture2:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/12.swf"null11512512nullfalse); 
   var 
pageTexture3:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/13.swf"null11512512nullfalse); 
   var 
pageTexture4:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/14.swf"null11512512nullfalse); 
   var 
pageTexture5:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/15.swf"null11512512nullfalse); 
   var 
pageTexture6:PageTexture = new PageTexture("http://www.neugls.info/example/flipbook/mac/files/normalpic/16.swf"null11512512nullfalse); 
   
   
   var 
bitmapTexture:BitmapData = new BitmapData(whtrue0xEEFF0000);
   
_cubeMaterial = new SkyBoxMaterial(new PageCubeTexture(pageTexture1pageTexture2pageTexture3pageTexture4pageTexture5pageTexture6));
   
_cubeMaterial.lightPicker lightPicker;
   
   
_cube = new Mesh(new CubeGeometry(whd111true), _cubeMaterial); 

PageCubeTexture and PageTexture are in the attached in the attachments.

It seems OK is w equals to h equals to d. But if w, h, d not equals to each other, the texture all goes wrong

Is this a bug? How can I fix this problem?


Thank you!

 

File Attachments
Try_to_apply_SkyBoxMaterial_to_Cube,_but_UV_map_error.zip  (File Size: 314KB - Downloads: 296)
   

jcarpe, Newbie
Posted: 06 July 2012 06:13 PM   Total Posts: 8   [ # 1 ]

I think you should be applying the SkyboxMaterial to a Skybox object.

away3d.primitives.SkyBox;

   

Avatar
loth, Sr. Member
Posted: 10 July 2012 07:24 AM   Total Posts: 236   [ # 2 ]

or you can use simple plane

   
   
‹‹ Local Axis Problems

X

Away3D Forum

Member Login

Username

Password

Remember_me



X