So, assuming by polygons you mean like a square:
Rectangle()
If you mean like a custom shape, I’d suggest using Vertices.
I’ve linked my repository that deals with this somewhat. I didn’t like Apple’s example in their documentation so I did this instead.
https://github.com/ibapps39/helloTriangle
It’s hard to give you concrete answer because there’s many ways of doing it, from Metal to SceneKit to Swift/SwiftUI‘s various shapes to UIKit, and etc.
Topic:
Graphics & Games
SubTopic:
General
Tags: