Dynamic Content on Prerendered Animation
Here’s a quick little demo that uses the DistortSprite class in AS3 to distort a dynamic image loaded through XML to match up in perspective to a pre-rendered, animated card.
PreRender Test (Flash 9 Required).
The basic concept here is that we have a prerendered animation from a 3D app, in this case Cinema 4D. And what we need to do is be able to dynamically attach images on top of that card in Flash. So we rendered out the animation from C4D without an image, and then motion tracked the 4 corners where the image would be placed in AfterEffects.
Then, by using Dr. Woohoo’s AE2Flash script, we were able to send that motion tracker data for the 4 corners out to an XML file. Since the dimensions of the Comp in After Effects are identical to the dimensions of the stage in Flash, the coordinates should line up. Then we simply run a DistortSprite class we have that just grabs 4 corners of a dynamic image and distorts them to those points that we calculated from the motion tracker. What we’re left with is the illusion of a dynamic image being transformed in 3D space along with our actual prerendered 3D scene.
May 24th, 2008 at 10:51 am
Hey Joseph,
Drew Trujillo sent me your way. I’m VERY interested in learning how you got the tracking points to import correctly into Flash and also kept the video in sync with the tracking point information. I’m doing something very similar and I’m having a heck of a time. Any advice?
Thanks!
joey
May 25th, 2008 at 7:55 am
Hey joey,
The best advice I can give you without any specifics is to just be very patient. It takes a lot of trial and error to get it right, since everything has to match up perfectly. However, once you’ve found a good system, try to automate it as much as possible using any number of scripts, since it’s very tedious work.
Is there any specific area that you’re having trouble with? I can probably help you along a lot easier if I know exactly which part you’re having trouble with. It’s been a little while since I worked on this project, but I’m sure I can dust off the old cobwebs and it’ll all come back to me. Let me know here or you can email me directly to joe -at- jarringsenses -dot- com. Good luck.
PS. Also, I know I haven’t been very active on this blog lately, but I very much plan to start posting again, and already have a backlog of about 10 tech posts I’m ready to write, so I hope you’ll keep visiting. Thanks.