I
I
Ilya Smirnov2019-07-09 19:26:37
C++ / C#
Ilya Smirnov, 2019-07-09 19:26:37

How to rotate an object by two points and not by the center?

There is a train, on turns it rotates around its center, but how to make it rotate from two points (front and rear carts)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Gaydak, 2019-07-10
@MrMureno

I don’t really understand what the point is either ..
if you have a car with front and rear wheels .. leave both of them on the rails (those same two points)
and if they are always on the rails, the car will turn by itself just following the wheels.
just try to organize the car as two points (front and rear wheels) that ride on rails ..
keeping the distance between them (because they are rigidly coupled)
and the "car" itself (its carcass). just put on a line between them in the middle of the middle of the car.
should roll and be very versatile and flexible)
or use some trick to rotate. let the car turn a little earlier, taking as a goal where it should "look" at a point on the rails a little ahead of itself for a couple of meters) a kind of LookaHead
a lot depends on the current implementation of the movement along the path))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question