Я обратился за помощью к ChatGPT, он предоставил первые два метода. Я написал последнее. Поскольку я уже работал с UV-координатами текстуры, я попробовал их использовать. Это действительно выстрел в темноте. Я не знаю, какие векторы мне следует искать. чтобы LinerRenderer рисовал нужные мне линии.
Код: Выделить всё
using UnityEngine;
using System.Collections.Generic;
public class MousePosition : MonoBehaviour
{
public LineRenderer lineRenderer;
public float radius = 1.0f; // The radius of your sphere
//public Vector2[] geoCoordinates; // Array of (latitude, longitude) points
public int numSegments = 100; // Number of segments for smoothness
private Vector3 prevHit;
void DrawCurvedLineOnSphere(Vector3 startPoint, Vector3 endPoint)
{
List linePoints = new List();
// Interpolate along the great circle path using Slerp
for (int j = 0; j
Подробнее здесь: [url]https://stackoverflow.com/questions/79129537/unity-using-linerenderer-to-draw-lines-on-a-sphere[/url]