Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Assertion: Obtained NAN during vector normalisation.
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=15&t=504
Page 1 of 1

Author:  TheSHEEEP [ Sat Apr 27, 2013 8:24 am ]
Post subject:  Assertion: Obtained NAN during vector normalisation.

Hey,

I'm continuing my terrain research with 3D noise with PolyVox, but I have come to a point, where I cannot get any result as I constantly get the following error:

Quote:
PolyVox Assertion Failed!
=========================
Condition: m_tElements[ct] == m_tElements[ct]
Message: Obtained NAN during vector normalisation. Perhaps the input vector was too short?
Location: Line 652 of ../../external_projects/built/win/polyvox/release/PolyVoxCore/include/PolyVoxCore/Vector.inl


I am using the latest code from the development branch.

One problem is that this error crashes the application. This obviously means I cannot see my noise results and therefore have no clue where that might cause the problem.

The other problem is that I have no clue why some noise results work and some don't. When I only slightly change the noise generation parameters, it might work perfectly or result in the quoted error.

What could be the problem here?
If you want, I could send you my project sources (it is a NetBeans project using Ogre & Accidental Noise Library).

Author:  TheSHEEEP [ Sat Apr 27, 2013 10:46 am ]
Post subject:  Re: Assertion: Obtained NAN during vector normalisation.

I tested some more and noticed that this happens far less often when I clamp the noise values form 0 to 1. It also seems to happen less often when I smooth the values after I generated them.

Correct me if I'm wrong, but I think that the mesh extraction should never fail. If the resulting mesh looks ugly, because the input values are weird, then the mesh looks ugly. But the algorithm should make sure that it does not end up with NaN ;)
So I think there must be some bug in the extractor that causes it to fail when some conditions are met in the volume values.

Author:  David Williams [ Sat Apr 27, 2013 1:18 pm ]
Post subject:  Re: Assertion: Obtained NAN during vector normalisation.

I have seen this myself, and I think you are probably right that it represents a bug in MarchingCubesSurfaceExtractor. However, I haven't looked into it in detail. I think in my case I just removed that assert - the outcome of this is that problematic normals keep a length of zero and so do not light properly.

This should be enough to let you continue. I've logged a bug here so do let me know if you work out what is going on.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/