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

MeshDraft.FlatRevolutionSurface throws ArgumentOutOfRangeException with generateUV = false #58

Closed
BasmanovDaniil opened this issue Sep 29, 2018 · 0 comments
Assignees
Projects

Comments

@BasmanovDaniil
Copy link
Member

Both lowerRingUV and upperRingUV are empty:

var draft = new MeshDraft {name = "Flat revolution surface"};
for (int y = 0; y < ringsVertices.Count - 1; y++)
{
var lowerRingVertices = ringsVertices[y];
var upperRingVertices = ringsVertices[y + 1];
var lowerRingUV = ringsUV[y];
var upperRingUV = ringsUV[y + 1];
for (int x = 0; x < horizontalSegments; x++)
{
Vector3 v00 = lowerRingVertices[x + 1];
Vector3 v01 = upperRingVertices[x + 1];
Vector3 v11 = upperRingVertices[x];
Vector3 v10 = lowerRingVertices[x];
Vector2 uv00 = lowerRingUV[x + 1];
Vector2 uv01 = upperRingUV[x + 1];
Vector2 uv11 = upperRingUV[x];
Vector2 uv10 = lowerRingUV[x];
draft.AddQuad(v00, v01, v11, v10, true, uv00, uv01, uv11, uv10);
}
}
return draft;

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

No branches or pull requests

1 participant