I have a map populated with entities controlled by GKAgents. The entities will seek targets, flee from others and perform other tasks.

Where I am getting stuck is that I would like the map to be spherical. I can think of two options to implement this:

  1. Since coordinates on a sphere have 2 dimensions, longitude and latitude, I could use GKAgent2D components then map them to the surface of a sphere in SceneKit. How can I subclass GKAgent2D and somehow transform the positional inputs and outputs to spherical polar coordinates?

  2. Alternatively I could use GKAgent3D components on the surface pf a sphere. How can I constrain the Agent’s behaviours to follow the surface of the sphere?

Finally, which of the above implementations would be more appropriate?



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.