mathematics – Compensate for gap when rotating plane in a row of planes


I have a row of planes in 3D space that form a road.

Upon rotating a tile around its center point to add a sloap to the road a gap forms like this:
Planes that form a road gap from rotation is shown

To compensate for this gap i developed this formula:

enter image description here

A = (POS - CON)
B = Rot(0, 0, w) * A
C = CON - (POS + B)

POS += C

(All blue values are known)
(Pseudocode)

Please note that the second line resembles a quaternion rotation that rotates vector A by w degrees around an axis through POS leaving your computer screen.

By moving the plane by the calculated amount the gap should be closed (at least as far as I understand) but there is always a small offset:
enter image description here
The offset increases with the rotation angle and gets even worse when the plane is rotated by a rotation not dividable by 90.

Is there a better way to do this or is there something I’m missing with my formula?



Source link

More To Explore

Share on facebook
Share on twitter
Share on linkedin
Share on email