-1
\$\begingroup\$

Let's say I have 2 similar objects I need to align together about the target's center at runtime. Given their positions (x, y, z) and rotations in the world, how would I do this? They need to match orientation as well.

I looked into using Iterative Closest Point but I wasn't sure if that was the right approach, as the objects need to be already overlapping.

edit -

visual added

\$\endgroup\$
  • \$\begingroup\$ I'm not sure what you mean by aligning the objects together. Could you please provide a visual example? \$\endgroup\$ – congusbongus Oct 31 '18 at 3:06
  • \$\begingroup\$ I edited the post with an example. Basically I want the blue box (which may be at a different position and orientation) to superimpose on top of the red box, which is the source. \$\endgroup\$ – cruelflames Oct 31 '18 at 3:51
  • 1
    \$\begingroup\$ Have you tried simply setting the orientation and position to be the same? \$\endgroup\$ – congusbongus Oct 31 '18 at 3:52
  • \$\begingroup\$ I've tried that. It varies, sometimes the rotation is off or the position is slightly offset from where it should be. \$\endgroup\$ – cruelflames Oct 31 '18 at 3:59
  • \$\begingroup\$ You should first normalise the centers and orientations of your objects. When you set their positions and orientations to a zero value, they should all naturally line up. \$\endgroup\$ – congusbongus Oct 31 '18 at 4:04

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.