Skip to content

MeshDraft.FlatRevolutionSurface throws ArgumentOutOfRangeException with generateUV = false #58

@BasmanovDaniil

Description

@BasmanovDaniil

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;

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions