« Microsoft Expression CTP available. | Main | Updates to some freebies... »
vCam v2 - roll your own
I've been seeing loads of requests to make the vCam rotation code available so that the vCam can be modified through a community effort. Well, here's the code to start you off...
The main problem with creating code that can rotate the view seen through the vCam is not the rotation code itself (that is the easy part), but the code that forces your rotation to occur around the center point of the vCam.
A second problem is that the rotation code uses trig, and performing trig calcuations every frame can slow your animations, so you need to run the rotation code only when it is required. You can do this via a conditional that checks whether the angle of the vCam (i.e. the vcam _rotation property) has changed since last frame.
The swf below shows a solution to the 'rotate around the vCam and not any other point' problem (written by Big Dave at work). If you click the swf, you will see a rotating rectangle (which can be made to be the full stage). This is rotating with a crosshair at the center of rotation. If you can make this crosshair the center of the vCam, bingo... vCam with rotation!
The fla can be downloaded here (Flash MX 2004, totally unoptimized AS v1.0 code, 6k file).
NOTE - this fla is not a vCam v2.... I've put it up for the programmers out there twho want to make a vCam by using this code as a starting point.
Posted by motiongraphics on February 26, 2006 11:39 PM
hello,
i cant seem to find the files for vcam anywhere
please can you tell me where they are
Posted on February 27, 2006 05:36 PM
Hi Fede.
Try here: http://www.oreillynet.com/pub/a/javascript/2004/08/17/flashhacks.html?page=2
The download files in this article contain the original vCam component.
Posted on February 27, 2006 09:27 PM
hi there i downloaded the Vcam but my flash Mx en flash 5 can't open it :S can you help me
Posted on March 28, 2006 12:59 PM
Hi robin.
The best place to get the vCam is at http://www.oreillynet.com/pub/a/javascript/2004/08/17/flashhacks.html.
Search the reader comments in the threads at the end of the article for Flash 5
Posted on May 1, 2006 01:31 PM
Rotating actionscript camera ^_^
Ummm, was writing in a letter and am too lazy to rewrite so here are the problems with it:
Rotating only works if the camera is scaled from the dimensions of the stage. ie the stage dimensions are 400x300 and the camera dimensions are 4x3 - in this case, the camera is able to rotate without skewing. Another example, the stage dims are 400x300 and the camera dims are 5x3 - the camera cannot be rotated (it must stay at 0 degrees _rotation) until its ratio (width:height) is proportionate to the stage's.
Code: view here
Download here (flash 8) : DynamicCamera.zip
-gotoAndFLASH
Posted on May 7, 2006 10:51 PM
o0o the links above are broken... the url was a bit off, sorry ^_^
Code here
Download here
Posted on May 11, 2006 03:01 AM
When will the VCam v2 be made available to us ShamB ? We are getting sooooooooo desperate for it . Why are you getting so late in that ? Please please do it soon .
Posted on May 17, 2006 12:42 PM
vcam 2 - still trucking then roll your own, seem like the truck had a flat and now we are left to travel alone - =) ok Kidding but for real any updates fella?
Posted on June 5, 2006 05:33 PM
Wow. Seriously I can't thank you enough for making this. I've actually been made speechless by a buncha code, who knew!
Posted on August 7, 2006 10:03 AM
bring on the fucking vcam v2!!!!! we need it... like a woman needs dick.... like a man needs pussy....like milk needs chocolate!!!!!!!
Posted on September 4, 2006 07:43 PM
where i can find the vcam2?
thank
Posted on December 22, 2006 10:01 PM
pleeeeeeeeeeaaaaaaaaase sham
when i can find the vcam2?
thank
Posted on December 22, 2006 10:09 PM
Sham...YOU HAVE HELPED ALLOT OF PEOPLE SINCE THE RELEASE OF vCam 1.0!
BUT WHAT IS HAPPENING WITH THE NEWER VERSION OF vCam???
All the users who use vCam and need rotation in their animation ARE WAITING FOR YOUR LATEST VERSION OF vCam!!
PLEASEEEEE CARRY ON WITH THE PRODUCTION OF THE NEXT vCam!
Its BEEN 2 YEARS I THINK! DON'T MAKE US WAIT ANY LONGER!!!
HELLLLLLLLLLPPPPPPPP
AT THE MOMENT THE CAMERA SKEWS WITH THE STAGE AS I ROTATE THE vCam COMPONENT IN MY FLASH MOVIE MAKING THE CLIPS ON THE STAGE THAT THE CAMERA IS FOCUSING ON..DISTORTED AND CHANGING ITS SIZE.
IM SURE YOU KNOW THIS ALREADY...S0o0o0o0 PLEASEEE HELPPP!!!!
THANK YOU
BEST OF LUCK!
WE HOPE TO HEAR FROM YOU SOOOOONNN!
Posted on February 4, 2008 04:01 PM
Sham...YOU HAVE HELPED ALLOT OF PEOPLE SINCE THE RELEASE OF vCam 1.0!
BUT WHAT IS HAPPENING WITH THE NEWER VERSION OF vCam???
All the users who use vCam and need rotation in their animation ARE WAITING FOR YOUR LATEST VERSION OF vCam!!
PLEASEEEEE CARRY ON WITH THE PRODUCTION OF THE NEXT vCam!
Its BEEN 2 YEARS I THINK! DON'T MAKE US WAIT ANY LONGER!!!
HELLLLLLLLLLPPPPPPPP
AT THE MOMENT THE CAMERA SKEWS WITH THE STAGE AS I ROTATE THE vCam COMPONENT IN MY FLASH MOVIE MAKING THE CLIPS ON THE STAGE THAT THE CAMERA IS FOCUSING ON..DISTORTED AND CHANGING ITS SIZE.
IM SURE YOU KNOW THIS ALREADY...S0o0o0o0 PLEASEEE HELPPP!!!!
THANK YOU
BEST OF LUCK!
WE HOPE TO HEAR FROM YOU SOOOOONNN!
Posted on February 4, 2008 04:04 PM
Awesome man!
This is so great, I can't thank you enough!
Posted on April 12, 2008 11:08 PM