This is the idea: there is sphere with radius = 1, the center is at 0,0,0. Now, this sphere works as a sort of a scanner - when you touch any point of the sphere a line is drawn to the center of the sphere (0,0,0) from the point of touching (origin point). Each frame the point expands and turns into a ring, like a ripple, moving on the surface of the sphere.
It might be a bit hard to visualize at first, but it's not that much of a difficult concept, I actually got it sort of working. The only problem - it only works from a few origin points, not from all.
This is the code:
for(int i = 0; i <= 180; i++)
{
origin = new Vector3(
2f * Mathf.Cos(i * (Mathf.PI / 180f)),
0f,
2f * Mathf.Sin(i * (Mathf.PI / 180f)));
for (int x = 0; x <= 360; x++)
{
quat = Quaternion.AngleAxis(x, Vector3.left);
Debug.DrawLine(quat * origin, direction_center, Color.red, 0.02f);
}
yield return new WaitForSeconds(0.01f);
}
Now, it only has one origin point and I'm aware of that, it's just that, rather than changing the origin point, I tried rotating the entire thing, which didn't work. Now, how would I go around actually defining the origin point (any point of a sphere surface) and have the ripple start from it?
Edit: I apologize for lack of information - to do this I'm using Unity, coding with C#. Aside from that, I'm not sure what other information should be required.
Edit 2:
I made a simple sketch of the idea - I need to find not every, but a 360+ points in the red circle. The circle starts from point A and ends at the opposite side of the sphere. Each frame I need to know the location of each point in 3D space. In this sketch there is only the point B. How could I calculate the position of B, knowing that the radius of the sphere and the position of point A? This formula should be applicable to any point.
One more example:
Edit 3: I have somewhat solved this, but in a different way without getting the equations. Because of this I do not know whether to answer my own question with a work around or leave the question for the actual answer, because this might help somebody.