Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OBJ File Fails to Convert with "mesh.h:940 CHECK failed: Uint16ToUtf8(za, utf8)" #35

Closed
GoogleCodeExporter opened this issue May 13, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

When the attached OBJ file is run with:

objcompress 'Brain.obj' 'Brain.utf8'

it fails with the following message:

mesh.h:940 CHECK failed: Uint16ToUtf8(za, utf8)

Since I have modified my source code, the line number is incorrect, however it 
is the CHECK() in CompressQuantizedAttribsToUtf8(). I have only modified MTL 
parser and JSON writing. The OBJ parser, UTF8 stuff, or binary writing 
functions have been modified at all.

Original issue reported on code.google.com by j...@coderforlife.com on 4 Apr 2012 at 4:38

Attachments:

@GoogleCodeExporter
Copy link
Author

Interesting...it appears you've hit a difficult to encode value, which I 
thought should be impossible based on the existing bounds params, but I'm 
definitely able to reproduce this. Taking a look now.

Original comment by wonchun on 9 Apr 2012 at 9:48

@GoogleCodeExporter
Copy link
Author

Ah, there are some normals with very large values, like:

vn -65.964500 26.871040 -325.114197

And the quantization code assumes that normal components are in [-1, 1]. On one 
hand, it is probably a good idea to be able to preserve the actual inputs. On 
the other hand, the easy thing is to just automatically normalize vn inputs. 
I'm leaning to the latter. Any thoughts?

Original comment by wonchun on 9 Apr 2012 at 10:20

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Normalization is probably the way to go. Is the magnitude of the normal vector 
ever actually used in ANY 3D render? I will ask about this from my source as 
well.

Original comment by j...@coderforlife.com on 9 Apr 2012 at 10:39

@GoogleCodeExporter
Copy link
Author

It might matter if you want to interpolate normals before normalizations. You 
can use the magnitude of the normal to act as a weight. I agree it is not 
obvious. I'm about to land the feature, and when I go through and hook up 
flags, then I'll have it default to normalize, but have it be switchable.

Original comment by wonchun on 9 Apr 2012 at 11:29

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r83.

Original comment by wonchun on 9 Apr 2012 at 11:34

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant