public static Vector3 GetPosition(Hipstar body) { var a = body.ra; var b = body.de; var c = body.dist; var x = (c * Math.Cos(b)) * Math.Cos(a); var y = (c * Math.Cos(b)) * Math.Sin(a); var z = c * Math.Sin(b); return(new Vector3((float)x, (float)y, (float)z)); }
private void CreateBody(Hipstar body) { var go = Instantiate(SpherePrefab); go.transform.position = Coor.GetPosition(body); var radius = (float)body.radius * 2; go.transform.localScale = new Vector3(radius, radius, radius); var text = go.GetComponentsInChildren <TextMesh>(); text[0].text = body.name; text[1].text = body.desig; }