There is a sphere. At it’s centre are long objects—let’s call them rays—anchored from one end. They all need to be radiating out at equidistant points through the surface of the sphere.
The model needs to be designed in a manner that can automatically recalculate positions based on the number of rays because the count will slowly increase over time and sometimes decrease.
I understand that purely equidistant placement is impossible to achieve in some cases, e.g. 5 points, but an approximation would be sufficient.
It’s called a Fibonacci lattice ( or one method of doing this ).
If you take a look at the module in Niagara called, SphereLocation ( double click it to see the code ), there is an option called ‘Uniform’ for the distribution.
This uses a lattice.
Basically, what you do is use polar coordinates to distribute items on your sphere. You can convert the polar coords to cartesian ( ie vectors ), using a formula
I will put my blueprint code up tomorrow, but not at the machine right now.
Wow! Thank you so much for this lead. I just played around a bit and it is exactly what I was hoping to find!
So, the next step is having objects anchor at the centre of the sphere and radiate out at the points as determined by Niagara>Particle Spawn>Sphere Location. I wonder if that can be achieved with ribbons, since I essentially do want to have ribbon-like formations coming out of the sphere.
Do you think I should open this up as a new question? Your answer really is the solution to the main topic question. If you agree, I’ll edit this post and post a new Q.
TSphericalFibonacci SphericalFibonacci(NumPoints);
// access index
const FVector3 RealType=SphericalFibonacci.Point(PointIndex);
// convert to normal vector for ue4
FVector SphericalCoord(RealType.X,RealType.Y,RealType.Z);