It is currently Sat Aug 22, 2020 3:38 am


All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Assertion: Obtained NAN during vector normalisation.
PostPosted: Sat Apr 27, 2013 8:24 am 

Joined: Thu Oct 06, 2011 2:26 pm
Posts: 46
Location: Berlin
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).

_________________
My site! - Have a look :)
Also on Twitter - with more ketchup


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Assertion: Obtained NAN during vector normalisation.
PostPosted: Sat Apr 27, 2013 10:46 am 

Joined: Thu Oct 06, 2011 2:26 pm
Posts: 46
Location: Berlin
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.

_________________
My site! - Have a look :)
Also on Twitter - with more ketchup


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Assertion: Obtained NAN during vector normalisation.
PostPosted: Sat Apr 27, 2013 1:18 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
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.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net