Hi folks,
i’m currently running into some trouble and i hope you could help me.
I would like to rotate multiple objects around another object NON-spherically but elliptically. Let’s assume i’ve a sphere which is scaled X=100, Y=30, Z=50 and i would like the other objects (about 100 or more) to rotate around or rather move on the surface of the sphere.
As my english is very weak and i’m unable to explain that in a better way, here comes a picture showing what i’m talking about.
So the objects should always be arranged like a “cloud” and move on the surface while touching or moving the mouse.
Currently i’ve attached a Behaviour-Script to each of the items:
if ((Input.GetMouseButton (0) || Input.touchCount == 1) && cloudStatus != CloudMode.Zoom) {
touchSpinHandler();
}
void touchSpinHandler(){
transform.RotateAround (Vector3.zero, Vector3.up, fingerPositionX * -Time.deltaTime * (spinSpeedFactor));
transform.RotateAround (Vector3.zero, Vector3.left, fingerPositionY * -Time.deltaTime * (spinSpeedFactor));
}
The second step i’ve to manage is some kind of “physics” which means, while i’m moving my finger faster, the objects should move closer to the center of the sphere and vice versa.
I would appreciate if some of you Unity3D-experts could tell me how to do that.
Thank you all in advance and have a great evening!