Hey All,

I had a specific situation where I needed to pan the hovercamera
without a limit. The current HoverCamera3d built into away3d has a pan
limit of 90 and -90, as past those limits the model would flip in a
bizarre manner.

The key method was to detect if the camera had flipped around to the
oppiste side:

                public function isflipped():Boolean{
                        var normalTilt:Number = Math.abs(_currentTiltAngle)%360;
                        return (normalTilt >= 90 && normalTilt <= 270);
                }

then also to set the Matrix3d orientation of the camera accordingly:

                arcane override function update():void
                {
                        var orientation : Vector3D = (isflipped())? new 
Vector3D(0,1, 0) :
new Vector3D(0, -1, 0);
                        if (target != null){
                                
lookAt(target.transform.matrix3D.position,orientation);
                        }
                        super.update();
                }

Anyway here is the example:
http://dev.aliencom.net/away3d/hovercameraflip/

and here is the source:
http://dev.aliencom.net/away3d/hovercameraflip/source.zip

My trig isn't strong so it took me a while to figure out how to fix,
so I hope it helps someone else save time.

Reply via email to