C#脚本
根据查询文献,真实世界中在地球上某个点作为参考点去描述太阳运行轨迹的决定参数有很多,比如:solar declination(黄赤交角or赤纬角-,取决于所在天数在每年的排序);H(太阳时角,距离12点所运行的角度,e.g.下午一点就是(12-13)*15°),经纬度。
此处就不详细解释了,上C#代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class SunMove : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
//找太阳,只有一个,所以就直接根据type找
Light lightComponent = FindObjectOfType(typeof(Light)) as Light;
if (lightComponent.type == LightType.Directional)
{
GameObject lightObject = lightComponent.gameObject;
}
else
{
Debug.Log("太阳组件有问题");
}
double[] monthly_solar_declination = new double[] { -20.1, -11.2, 0, 11.6, 20.1, 23.4, 20.4, 11.8, 0, -1