Reputation: 1448
I would like to have a MovieClip that has a bit of depth. I can't use rotationX, rotationY or rotationZ because I have to use Flash CS3.
The first image is what I have now, a flat movieclip. The second is what I should have.
I already tried using a matrix, but that didn't work. I posed a question about it, and there somebody sugested that I should use a 3D engine to get the result I want.
Since it was a MovieClip that had to be in 3D I used now a MovieClipSprite.
var movieClipSprite:MovieClipSprite = new MovieClipSprite(myMC);
var view:View3D = new View3D({x:200,y:200});
var cam:Camera3D = new Camera3D();
cam.zoom = 1;
cam.y = 100;
view.camera = cam;
cam.lookAt(new Number3D(0, 0, 0));
this.addChild(view);
view.scene.addSprite(movieClipSprite);
view.render();
It didn't matter how I changed the camera, I always have got the same result. The flat movieclip.
Then I read in the Away3D documentation
MovieClipSprite: Spherical billboard (always facing the camera) sprite object that uses a movieclip as it's texture. Draws individual display objects inline with z-sorted triangles in a scene.
I think that's why it always gives the same result.
I also tried something with MovieMaterial, but I never have got that working.
Can you please help me to put my movieclip in perspective?
Thanks a lot!
Vincent
Upvotes: 0
Views: 439
Reputation: 168
Is "view.render" in a enter_frame function ?
It worked for me with flashdevelop & Away3d 4.0 :
public var aSprite:Plane = new Plane(new ColorMaterial(0xFF0000));
public var cam:Camera3D = new Camera3D();
public var view:View3D = new View3D(null,cam);
public function test()
{
this.addChild(view);
var vec:Vector3D = new Vector3D();
cam.y = -300;
cam.lookAt(vec);
view.scene.addChild(aSprite);
this.addEventListener(Event.ENTER_FRAME, onFrame);
}
public function onFrame(e:Event):void
{
view.render();
}
Upvotes: 2