1
Vote

ScreenSpaceLine3D throws null reference exception

description

Hello

comments

hesojam wrote Jul 7, 2014 at 2:07 PM

I've got the same error.
For me, it happens when ever I remove the ScreenSpaceLine3D instance from the 3dViewport.
It seems that it calls the method "TryWorldToCameraTransform()" even after it has been removed from the viewport.

I think, some events or delegates aren't poperly unregistered and cause a recalculation when the object is no longer registered in a viewport.

Greetings
Chillersanim

JohannBescond wrote May 17, 2015 at 3:29 PM

Remove ScreenSpaceLines3D :
            foreach (ScreenSpaceLines3D line3D in lines3DList)
            {
                __lines3D.Points.Clear(); // Very importante__
                _viewport3D.Children.Remove(lines3D);
             }