Hi Rujia,

Thanks for taking the time to help.

I suspect it probably is something I'm doing. I've tried tracing
everything that I can and at present I just can't see where it is
getting the NaN coordinates.
I'll follow your advice and try to find the source of the problem.

The good news is that I've switched back to 3.4.2 and I've been
playing with the same project for over an hour without any such error.
Which is great as I have to submit a demo on Friday!

Can you tell me how you would 'usually' end up submitting NaN
coordinates? Perhaps I might be doing something similar.

Cheers

D

On Jul 14, 3:56 pm, Rujia Liu <[email protected]> wrote:
> 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