Calculate rotation matrix.

Discussion in 'MATLAB' started by Paul B, Feb 22, 2011.

  1. Paul B

    Paul B Guest

    I have two collections of points (M and Mdash) that define the same 3d shape. They are of the format:
    X0 Y0 Z0
    X1 Y1 Z1
    X2 Y2 Z2
    ... .. ..

    I need to be able to calculate the rotation matrix required and convert it to axis/angle format for VRML 3d files. Currently I am using the vrrotmat2vec function to convert the rotation matrix

    I have tried Mdash\M, which works most of the time, but sometimes I will get imaginary output of vrrotmat2vec. I have tried only passing the real component of the result, but the rotations are off.

    Is there another good way to generate a working rotation matrix from these lists of points?

    Thanks!
     
    Paul B, Feb 22, 2011
    #1
    1. Advertisements

  2. Paul B

    Matt J Guest

    =========

    You can use my absolute orientation tool to get the rotation matrix (and translation vector) if there is one

    http://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horns-method


    What toolbox is that?
     
    Matt J, Feb 22, 2011
    #2
    1. Advertisements

  3. Paul B

    Paul B Guest

    Paul B, Feb 23, 2011
    #3
  4. Paul B

    Paul B Guest

    Paul B, Feb 24, 2011
    #4
  5. Paul B

    Matt J Guest

    You mean it takes a little longer than Mdash\M?
    That's to be expected.

    If your data contains any significant measurement errors, you can't obtain the rotation matrix just by solving a set of linear equations. The linear solver doesn't know that the solution needs to be constrained to the family of rotation matrices. That takes extra work.
     
    Matt J, Feb 24, 2011
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.