Search Unity

Orient source 4 points to target 4 points

Discussion in 'Scripting' started by NRogeau, Oct 18, 2019.

  1. NRogeau

    NRogeau

    Joined:
    Jun 20, 2019
    Posts:
    1
    Hi,

    I have 4 points as source and 4 points as a target.

    How can I orient source points to target points?
    Scheme attached.

    If yes can I get the transformation matrix too?

    How to transform these source points to target ones:
    //source orign, x, y, z points
    List<Vector3> source = new List<Vector3>() {
    new Vector3(0,0,0),
    new Vector3(1,0,0),
    new Vector3(0,1,0),
    new Vector3(0,0,1),
    };

    //source orign, x, y, z points
    List<Vector3> target = new List<Vector3>() {
    new Vector3(-0.365179f,-2.491005f,0.537208f),
    new Vector3(0.247631f,-2.353977f,1.315467f),
    new Vector3(0.191693f,-3.264649f,0.234937f),
    new Vector3(0.195497f,-1.872379f,-0.013196f),
    };
     

    Attached Files:

    Last edited: Oct 18, 2019