Rotation of the actor

I have two actors. Each actor has a certain vector having a relative position and direction. How to make these actors stand in a position in which the vectors will be directed oppositely and the positions of the vectors will coincide?

No. Each actor has two vectors in variables: 1) Position vector (p); 2) The direction vector (d). It is necessary to arrange the second actor relative to the first so that n1 == n2 and d1 == d2 * -1.

That’s about what I want to get:





The arrow is attached to the cone. The left cone is the parent, the right cone is the child who attaches to the parent. They are attached to each other in that place and with such a turn, so that what is shown on the screenshots is obtained.

Do you mean invert the vector by multiplying it by -1?

On the left one, is it the arrow or the cone that’s rotated 90 degrees?

There can be many arrows. Any arrow of the first cone can be connected with any arrow of the second. I need a formula by which I can correctly convert the position and rotation of the second cone.

Hi, could you be a little bit more precise about what you’re trying to achieve and the constraints of it? :slight_smile:

In the equation above you’ve never said what n1 or n2 is (but I assume it’s the position and you’re trying to get both arrow bases to the same position but with opposite rotation, but that’s not what you’re showing in the second image).

Even so you will have an infinite amount of valid solutions, since after the direction of the arrows is aligned, you can still rotate them in one axis.

So if the base of the array is your actor location, then align both position by first getting the position of the first actor and setting the second actor to that position. For the direction use conversion from cartesian coordinates to spherical coordinates to get the angles and from those angles the direction Spherical coordinate system - Wikipedia → Coordinate system conversions → Cartesian coordinates. Since you can still freely rotate both arrows around one axis this will only give you two angles (you would need an additional constraint to get only one solution instead of an infinite amount of them).

Yes, you understood me correctly.
As a limitation, I wanted to introduce an angle that is on the axis of rotation of the arrows.

I myself would’ve made the cones children of the arrows, that way the transforms can be matched. Otherwise the right cone will have to be moved up and across by the height value and rotated by 90 degrees.