AnimatedBitmapMaterial & plane back side

Software: Away3D 4.x

Colir, Newbie
Posted: 02 December 2011 09:03 AM   Total Posts: 21

Hi,
I try to convert an animation that i done with away3.6 to away3d 4.
To simplify my animation concept,
it’s like a door with 2 movie material, one on each side.

First : the AnimatedBitmapMaterial size
if i directly use my movieclip in my animatedBitmapMaterial declaration
i have the following error

ErrorInvalid bitmapDataMust be power of 2 and not exceeding 2048 

...ok normal…so i transform my movieClip to fit the size of 400x400 (200x400 before), but i have the same error…

Do you have an idea on what’s going on ?
When using animatedBitmapMAterial, perhaps it could be a very nce feature if it can be resize by power of 2 automatically…


Second : plane back side
I didn’t find how to setup a different material on the backside of a plane in away 4…


thanks for your help

   

Jan D, Newbie
Posted: 02 December 2011 09:19 AM   Total Posts: 8   [ # 1 ]

Power of two does not mean that something is dividable by two.
Power of two means: 2, 4, 8, 16, ..., 256, 512, 1024…

And it seems as if flash (or the new version of it, not sure) does only take textures in that format as input for 3D. I don’t like that, either wink

So, in your example, a 256x512 texture should work.

   

inSertCodE, Sr. Member
Posted: 02 December 2011 04:55 PM   Total Posts: 105   [ # 2 ]

...and the answer of you second question can be partly found here:

http://away3d.com/forum/viewthread/1477/

...just add some different material to the second sub-object.

   

Colir, Newbie
Posted: 02 December 2011 05:30 PM   Total Posts: 21   [ # 3 ]

Thanks to you for yopur help..
i ‘m a little bit disappointed that this is so complicate…

@Jan D
thanks, a movie clip sized 256x512 work well…but very complicate to transform all my clip in power of two…
but it’s not your fault wink

@inSertCode
i have well clone the plane geometry, but how to add a new material to it ?

thanks

   

inSertCodE, Sr. Member
Posted: 03 December 2011 02:15 AM   Total Posts: 105   [ # 4 ]

_plane.subMeshes[0].material = _material1; //for the first sub-object
_plane.subMeshes[1].material = _material2; //for the second sub-object

...and so on…

ps. and don’t forget to reverse the normals of the cloned plane if you are using lights.

   

Colir, Newbie
Posted: 05 December 2011 08:29 AM   Total Posts: 21   [ # 5 ]

thanks four your help…
but this doesn(t work for me…don’t know what going wrong.. isee only the front material

var step1LeftFrontMat:AnimatedBitmapMaterial = new AnimatedBitmapMaterial(step1Left,false,false,0,null);
var 
step1LeftBackMat:AnimatedBitmapMaterial = new AnimatedBitmapMaterial(step1LeftBack,false,false,0,null);
   

var 
leftPlane:Plane = new Plane(null,200,400,1,1,true)
var 
backPlane:SubGeometry;
backPlane leftPlane.subMeshes[0].subGeometry.clone();
leftPlane.geometry.addSubGeometry(backPlane);
for (var 
i:int 0leftPlane.subMeshes[1].subGeometry.numVertices 3i++) {
     
if(leftPlane.subMeshes[1].subGeometry.vertexNormalData[i] == 1){
 leftPlane
.subMeshes[1].subGeometry.vertexNormalData[i] = -1;
 
}

leftPlane
.subMeshes[0].material step1LeftFrontMat
leftPlane
.subMeshes[1].material step1LeftBackMat 

thanks

   
   
‹‹ autodesk viewCube

X

Away3D Forum

Member Login

Username

Password

Remember_me



X