[Papervision3D] flying camera around
James Acres - AG
james at anonymousgroup.com
Mon Jun 11 15:09:23 EDT 2007
Hi John,
I worked on something exactly like that last week ;) It turned out
really well! I'd post it, but I'm having the bitmap width and height
problem I posted earlier today. Can't figure it out - any ideas?
Here's a snippet of how I rotated around the sphere:
var currPlane = plane_array[ planeId ];
var planeVector:Number3D = new Number3D( currPlane.x, currPlane.y,
currPlane.z );
var len:Number = planeVector.modulo + viewingDistance;
planeVector.normalize();
Tweener.addTween( camera, { x:planeVector.x*len, y:planeVector.y*len,
z:planeVector.z*len, time:1.25, transition:"easeinoutexpo",
onComplete:onShowName, onCompleteParams:[count]} );
Basically getting the normalized vector of the plane object and
multiplying it by the length of the original vector plus the desired
viewing distance. I'm using Tweener to take care of animating the
properties. Also, every frame I'm telling the camera to lookAt() the
plane. This is simple and works extremely well. Instead of constantly
calling lookAt() you could do the math yourself.
On 11-Jun-07, at 2:37 PM, John Grden wrote:
> I wonder if anyone's done something like this:
>
> 1. generated random planes around a sphere
> 2. told those planes to look at the sphere
> [ that part works fine ;) ]
> 3. Flown a free camera around the outside of those planes to a
> specified plane and had it look at the plane with the same
> rotation (IE:, like the flickr example we saw a while ago, but
> flying around a sphere?)
>
> Here's snapshot of what I'm working with. Imagine being able to
> specify any of those planes, and have the camera animate around the
> outside, then reposition itself infront of the plane fully rotated
> to match the plane
>
> Anyone?
>
> I've created a "dummy" displayObject3D to copy the new panel's
> transform, then move back 500 - then I'm trying to fly to this new
> position where the dummy is. So, I have the "where to fly" down,
> just need some help flying in a radius / 360 I guess ;) Not
> totally sure.
>
> I've been trying to get the scene just to rotate and re-orient
> itself to the camera position (opposite the sphere's rotation
> values) and that's not working as I would hoped.
>
> --
> [ JPG ]
> <sphereRandomPanels.png>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
More information about the Papervision3D
mailing list