Cube materials

Software: Away3D 3.x

loveforvdubs, Newbie
Posted: 29 November 2011 09:28 PM   Total Posts: 4

Hello everyone. I am pretty new to Away3D and I am having some trouble with cubes. I am trying to make a banner that rotates, so I have a cube with an image on the front, top, back, and bottom faces. I did this using BitmapMaterial and the CubeMaterialsData class. The problem is that all but the front face are facing the wrong dircetion. The top and bottom faces are spun 90 degrees and the back face is spun 180. What is causing this? Is there a simpler way to make a cube with images on it? Do I need to use a skybox? Any help would be greatly appreciated. Thanks!

   

inSertCodE, Sr. Member
Posted: 29 November 2011 10:51 PM   Total Posts: 105   [ # 1 ]

Quick and simple, rotate the source images of the faces…

Option 2 would be to adjust the UVs of the cube.

 

   

loveforvdubs, Newbie
Posted: 30 November 2011 01:35 PM   Total Posts: 4   [ # 2 ]

Rotating the source images wouldn’t quite get me there. For the back face where it is spun 180 this would work, but for the top and bottom faces it would not, the reason being that the pieces are spun 90 individually. So this would not quite solve my problem. I tried creating the materials as TransformBitmapMaterial and then rotating the UV but that gave me unpredictable results. I am pretty new to the 3D world. What is the scale of UV rotation? I know that movement is a percent, is it the same for rotation. Would 0.5 be a half rotation? I tried this for the face that is spun 180 degrees and that did not give me a true half rotation. It was spun more like 100 degrees. I think there is some big picture bit that I am missing because I am so new to this. Perhaps how 3D surfaces interact or how they are located relative to each other. Any ideas?

 

   

inSertCodE, Sr. Member
Posted: 30 November 2011 01:45 PM   Total Posts: 105   [ # 3 ]

Can you upload the picture that you are using in the material?

 

   

loveforvdubs, Newbie
Posted: 30 November 2011 01:57 PM   Total Posts: 4   [ # 4 ]

I have attached 3 of the images, I can only attach 3, but there are 4 banners. I wrote a splitter class that splits each of these into 10 pieces. Then 10 cubes are created and then one piece of each of the 4 banners is applied to a side of the cube. Then all 10 cubes are placed right next to each other. This gives the illusion that it is a solid banner, until you start rotating the cubes individually, then it is a 3D sliced banner.

 

   

loveforvdubs, Newbie
Posted: 30 November 2011 02:02 PM   Total Posts: 4   [ # 5 ]

Also here are some screen shots of the program in action to really highlight the problem. You can see that the blue side is not parallel to any side of the cube, this is because I tried rotating that side by 0.5 and that’s the result I got.

 

   
   
‹‹ bothsides and lights

X

Away3D Forum

Member Login

Username

Password

Remember_me



X