Sprite3D and Filter3D [ Solved ]

Software: Away3D 4.x

Avatar
Jeff, Newbie
Posted: 03 October 2011 03:15 AM   Total Posts: 30

Hi,

I have a problem when I apply a filter3D with a Sprite3d on scene. The sprite is rescaled ( like getting closer to the camera ), primitives ( cube, plane ... ) are fine.

I have tried to find a solution around the Sprite3D pushModelViewProjection function without success. If I set the same transformation used on primitives, the problem is fixed but I lost all Sprite3D behavior ....

There is a comment on Sprite3D.as “// todo: find better way” maybe this is a work in progress ? Masters grin ?

Any help appreciate, thank you in advance wink

Regards,

Jeff

   

Avatar
Jeff, Newbie
Posted: 03 October 2011 05:14 PM   Total Posts: 30   [ # 1 ]

Still searching without success .... don’t understand why i have these result on pushModelViewProjection

This is correct : ( object stay at their location when a filter3d is on/off )

mvp.copyFrom(camera.renderToTextureProjection);
mvp.appendScale(30, 30, 1);

but not this : ( object move closer to the camera when a filter3d is on )

mvp.copyFrom(camera.inverseSceneTransform); 
mvp.append(camera.lens.matrix);
mvp.appendScale(30, 30, 1);

...... some help please

   

Avatar
Jeff, Newbie
Posted: 03 October 2011 09:36 PM   Total Posts: 30   [ # 2 ]

Problem solved

Sprite3D actually do not apply filter3D texture scale after lens matrix transform, the right pushModelViewProjection might be :

var mvp : Matrix3D = _mvpTransformStack[_mvpIndex];
mvp.copyFrom(sceneTransform);
mvp.append(camera.inverseSceneTransform);
 
var comps:Vector.<Vector3D>; 
comps = mvp.decompose();
comps[1].setTo(0, 0, 0);
mvp.recompose(comps); 
 
mvp.append( camera.lens.matrix);
mvp.appendScale(camera._textureRatioX, camera._textureRatioY, 1 );
mvp.copyColumnTo(3, _pos);
_zIndices[_mvpIndex] = -_pos.z; 

cheers grin

   

Avatar
Alejandro Santander, Administrator
Posted: 05 October 2011 01:59 AM   Total Posts: 414   [ # 3 ]

Thanks Jeff, I’ve added this to the GitHub issue list.

   

Avatar
Jeff, Newbie
Posted: 05 October 2011 07:56 AM   Total Posts: 30   [ # 4 ]

Hi Alexandro,

You are welcome, I had already added this on git issue list ( #129 ).

   

Avatar
Alejandro Santander, Administrator
Posted: 05 October 2011 02:31 PM   Total Posts: 414   [ # 5 ]

Ahh, missed it! I removed mine and edited yours as a bug. Thanks again!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X