I have seen the same error message quite a few times but after some
debugging, they're due to my own code EVERY TIME.

to find out the real cause, you can place a breakpoint at:

                   if (isNaN(_sz))
                       throw new Error("isNaN(sz)");

and inspect related variables. If you can't see any problem, try to output
more information with trace(). In my cases, it's always because I'm
assigning NaN coordinates to objects, so the lens cannot do the projection

You can temporarily change the code into

On Wed, Jul 14, 2010 at 11:47 AM, dapdap <[email protected]> wrote:

> Hi Guys,
>
> I'm making an Augmented Reality game.
> I'm using Flartoolkit from FlarManager 2.5.2
> Also Away3d tags\3.5.0
>
> It runs fine most of the time but occasionally I get the error
> [Fault] exception, information=Error: isNaN(sz)
>
> This is occuring in ZoomFocusLens.as which is called using
> setTransformMatrix with the positional data of a Marker/FLARBaseNode
>
>
> **********************************************************************************************************
>
>        /** @private */
>                arcane override function project(viewTransform:MatrixAway3D,
> vertices:Array, screenVertices:Array):void
>        {
>                _length = 0;
>
>                for each (_vertex in vertices) {
>
>                        _vx = _vertex.x;
>                        _vy = _vertex.y;
>                        _vz = _vertex.z;
>
>                    _sz = _vx * viewTransform.szx + _vy * viewTransform.szy
> +
> _vz * viewTransform.szz + viewTransform.tz;
>
>                    if (isNaN(_sz))
>                        throw new Error("isNaN(sz)");
>
>
> *****************************************************************************************************************
>
> I've set up a routine that checks the data before I send it to ensure
> everything is a Number.
> So the problem shouldn't be with MatrixAway3D.
> This would suggest that somehow the vertices:Array occasionally has
> data that is not numerical?
>
> If so - how would that happen?
>
> At the moment I'm very stumped.
>
> I think (though I need to check more) that it works okay with 3.4.2
>
> I'm certainly no powerhouse when it comes to AS3 so any help/
> suggestions would be very gratefully received
>
> Cheers
>
> D
>
>
>
>
>
>
>
>
>
>

Reply via email to