clicking on a sphere

后端 未结 2 990
南方客
南方客 2021-01-06 14:51

I have a unit sphere (radius 1) that is drawn centred in orthogonal projection.

The sphere may rotate freely.

How can I determine the point on the sphere tha

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-06 15:16

    One possible approach is to generate the sphere from triangles, consisting of rows and columns. They can be invisible too. And then hit-testing those triangles with a mouse pick ray.

    Latitude/longitude grid

    See this picture's latitude/longitude grid, but apply it much denser. For each grid cell, you need 2 triangles.

提交回复
热议问题