-
Notifications
You must be signed in to change notification settings - Fork 2
How to add normals and UV data? #3
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
Comments
Here's an example to add normal data:
In the default case it's identity mapping, which means the number of normals/UV should be the same to the position data. If you want to manually map the entry to specified position point, you can use following code:
|
var mesh = new DracoMesh(); var attrNormal = PointAttribute.Wrap(AttributeType.Normal, normals); var drcBytes = FileFormat.Drako.Draco.Encode(mesh, encodeOptions); Why is adding normal compression after adding vertices and indexes incorrect? |
Can you provide full code sample to reproduce this? I have updated the test case with a working code. |
I have found the cause of the problem. |
Good to hear that. This strange unnecessary requirement was inherited from the original draco implementation. I'll update this behavior in the next version. |
var mesh = new DracoMesh();
var attrPos = PointAttribute.Wrap(AttributeType.Position, controlPoints);
mesh.AddAttribute(attrPos);
mesh.Indices.AddRange(indices);
How to add normals and UV data?
Use the following method to compress errors.
var attrNormal = PointAttribute.Wrap(AttributeType.Normal,1, normals.ToArray());
mesh.AddAttribute(attrNormal);
The text was updated successfully, but these errors were encountered: