![]() ![]() ![]() In figure 1, you can see how a point P gets mapped to the surface of a sphere. However, when you want to move an object on the surface of an invisible sphere, like in this case, it makes sense to convert the cartesian coordinates to spherical coordinates, which use the radius and two angles to define the position of the object on the sphere’s surface: Figure 1: A point P can be described using a radius and two angles By default, Unity uses cartesian coordinates to describe where objects are located in a virtual 2D or 3D space. Conversion from spherical to cartesian coordinates and vice versaīefore I give you the code, let’s take a look at how you can convert cartesian coordinates to spherical coordinates and vice versa. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |