// Update is called once per frame void Update() { double jd = skyModel.GetJD(); LocationData location = skyModel.GetLocation(); if (sim.DT.playMode && sim.IsLocationUpdated()) { //reset gameObject.transform.rotation = Quaternion.identity; //correction for latitude double latitudeRotationAngle = 90.0d - location.latitude; //gameObject.transform.Rotate( (float)latitudeRotationAngle, 0, 0 ) ; earthAxis = skyModel.GetEarthAxis(); //correction for hour angle double hourAngleRotationInDegrees = skyModel.GetHourAngleOfAriesPoint() * 15d; gameObject.transform.Rotate(0.0f, (float)hourAngleRotationInDegrees, 0.0f); gameObject.transform.Rotate((float)latitudeRotationAngle, 0.0f, 0.0f); } else if (!sim.DT.playMode && sim.IsTimeOrLocationUpdated()) { //reset gameObject.transform.rotation = Quaternion.identity; //correction for latitude double latitudeRotationAngle = 90.0d - location.latitude; //gameObject.transform.Rotate( (float)latitudeRotationAngle, 0, 0 ) ; earthAxis = skyModel.GetEarthAxis(); //correction for hour angle double hourAngleRotationInDegrees = skyModel.GetHourAngleOfAriesPoint() * 15d; gameObject.transform.Rotate(earthAxis, (float)hourAngleRotationInDegrees); gameObject.transform.Rotate((float)latitudeRotationAngle, 0.0f, 0.0f); } }
private void RotateSkyGlobe() { //reset gameObject.transform.rotation = Quaternion.identity; //correction for latitude double colatitude = 90.0d - location.Latitude; //topocentric vector of earth axis Vector3 earthAxis = skyModel.GetEarthAxis(); //correction for hour angle double hourAngleRotationInDegrees = skyModel.GetHourAngleOfAriesPoint() * 15d; gameObject.transform.Rotate(earthAxis, (float)hourAngleRotationInDegrees); gameObject.transform.Rotate((float)colatitude, 0.0f, 0.0f); }