Vertex normal calculation sample errors

Vertex normal calculation sample errors

Anonymous
Not applicable
505 Views
2 Replies
Message 1 of 3

Vertex normal calculation sample errors

Anonymous
Not applicable

Hi, I'm attempting to use the sample function at the bottom (ComputeVertexNormals) of this documentation. The sample has syntax errors which don't allow it to compile. I've managed to fix those errors, but it doesn't seem to work as described. Instead of using the VNormal class, I'm using the VertexNormal class which is defined in vertexnormal.h. When the code hits the constructor of VertexNormal, it simply crashes. I switched to using dynamically allocated VertexNormals, and it solved the crashing issue. Is there any reason why it shouldn't work as is?

0 Likes
506 Views
2 Replies
Replies (2)
Message 2 of 3

drew_avis
Autodesk
Autodesk

Hi Brandon, so first off, thank you for mentioning the documentation topic specifically - I've created a defect against it to clean up the syntax problems.

 

Secondly, the implementation of VertexNormal in the SDK is very similar to the sample, so that should work as is.  It will take me a few days to set up and investigate, but would you be able to post your code to give me an idea of the context?

 

Drew



Drew Avis
Content Experience Designer
0 Likes
Message 3 of 3

Anonymous
Not applicable

Hi Drew,

 

Thanks for looking into the issue. I figured that the VertexNormal class was very similar which is why I subbed it in. I actually think that the code is working correctly once I switched from initializing all the VertexNormals on the stack to initializing them dynamically on the heap. I'm not sure why it was crashing in the constructor when initializing statically. Once I got through that bump, everything seems to work great!

0 Likes