Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class finalna : MonoBehaviour {
- float xz;
- float yz;
- float xm;
- float ym;
- float zm;
- public float az = 15;
- public float am = 5;
- float vz;
- float vm = 0;
- public float i = 5;
- public float omega;
- public float n = (float)0.1;
- float nom;
- public float odnosnomega = 18;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- if (vm == 359.9) vm = 0;
- else vm = vm + (float)0.1;
- vz = n * vm;
- nom = odnosnomega * n;
- omega = nom * vz;
- xz = az * Mathf.Cos (vz);
- yz = az * Mathf.Sin (vz);
- xm = am * (Mathf.Cos (omega) * Mathf.Cos (vm) - Mathf.Sin (omega) * Mathf.Cos (i) * Mathf.Sin (vm));
- ym = am * (Mathf.Sin (omega) * Mathf.Cos (vm) - Mathf.Cos (omega) * Mathf.Cos (i) * Mathf.Sin (vm));
- zm = am * Mathf.Sin (i) * Mathf.Sin (vm);
- GameObject.Find("Zemlja").transform.position = new Vector3(xz, yz, 0);
- GameObject.Find("Mesec").transform.position = new Vector3(xm, ym, zm);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement