I want to create procedural meshes along the spline but I can’t find the correct rotation for each section to line up.
What I want to fix here is the rotation of each section.
This is a rebuild using cones instead of procedural mesh for debugging purposes. I can’t use the “Find Look At Rotation” or “Add Spline Mesh” because I’m actually using procedural mesh and only having vertices instead of mesh.
I’m trying to do this in the blueprint and what I can find is the function"Rotate Vector Around Axis"
I use a random vector as direction for the spline. Assuming the cross product of this direction and up vector would be the appropriate axis for the rotation, and the included angle between direction and the vector from the same plane of the mesh is the angle for rotation.
What I want is every cone’s apex pointing at the next cone’s center of the base instead of this wired stuff.
I’m bad at math and not even sure if I’m doing the right calculation. Is it correct that cross-product suppose to give out a vector that perpendicular with both input vector? Is acos of the dot product between two vectors suppose to give out their included angle?
I also got confused that the first mesh got some input for angle as printed in green, yet others got nothing which shows in blue. I simply passed the initial random direction to the next mesh and rotated randomly before using it as a new direction.
Did I misunderstand the function of “Rotate Vector Around Axis”?
It’s so frustrating that I have no clue what’s happening for a couple of days. Any help will be appreciated. Thanks a lot.