Select to view content in your preferred language

Apply mesh modification to layers

568
2
Jump to solution
09-05-2023 02:27 AM
daicz
by
New Contributor II

I don't understand the description.

daicz_0-1693905906893.png

 

I implemented the feature in UnrealEngine with blueprints, but I don't know how to implement it in Unity. Here is my attempt in Unity, unfortunately it fails

daicz_1-1693905930016.png

 

Can you tell me the correct code steps?

Thanks!

0 Kudos
2 Solutions

Accepted Solutions
mericeen
New Contributor

Hi, you just need to convert geometry to polygon and add it to the mesh layer. The code below works fine in Unity.

 

 ArcGISPolygonBuilder pb = new ArcGISPolygonBuilder(ArcGISSpatialReference.WGS84());

pb.AddPoint(x1, y1);
pb.AddPoint(x2, y2);
pb.AddPoint(x3, y3);
pb.AddPoint(x4, y4);

            ArcGISMeshModification mm = new ArcGISMeshModification((ArcGISPolygon)pb.ToGeometry(), ArcGISMeshModificationType.Clip);

            layer.MeshModifications.Add(mm);

View solution in original post

daicz
by
New Contributor II

That's exactly what I want. Thank you very much!

View solution in original post

2 Replies
mericeen
New Contributor

Hi, you just need to convert geometry to polygon and add it to the mesh layer. The code below works fine in Unity.

 

 ArcGISPolygonBuilder pb = new ArcGISPolygonBuilder(ArcGISSpatialReference.WGS84());

pb.AddPoint(x1, y1);
pb.AddPoint(x2, y2);
pb.AddPoint(x3, y3);
pb.AddPoint(x4, y4);

            ArcGISMeshModification mm = new ArcGISMeshModification((ArcGISPolygon)pb.ToGeometry(), ArcGISMeshModificationType.Clip);

            layer.MeshModifications.Add(mm);

daicz
by
New Contributor II

That's exactly what I want. Thank you very much!