X and Y Vectors ?

Discussion in 'AutoCAD' started by BillZ, Jun 15, 2004.

  1. BillZ

    BillZ Guest

    R2005 Vlisp:

    I have a Xvector and Yvector direction for a named UCS that I created. I would like to understand these more.

    XVector = (0.866025 0.5 6.30304e-016)
    YVector = (-0.247193 0.428151 0.869242)

    It appears to me that the first two elements of the Xvector are the cosine and sine of the angle of the Xdirection from 0.
    But with the Yvector, the first two elements appear to be the distances in the X and Y that create the angle, with the third element being the sine of the angle from the XY plane.

    Am I correct in assuming this? And if so, what would be a simple way to create X and Y vectors when the known elements are just the angles from the xy and yz planes?

    Thanks for any constructive input.

    Bill
     
    BillZ, Jun 15, 2004
    #1
  2. BillZ

    Devin Guest

    BillZ,

    it's not a vector as much as it is a UNIT VECTOR, the length of which or the
    magnitude always is equal to 1.0. They are the individual elements that
    make up the rotation matrix. The rotation matrix is made up of an x unit
    vector a y unit vector and a z unit vector. And if they're not oriented
    properly unexpected results will occure (ie: if the y unit vector isn't 90
    degrees from the x unit vector on the xy plane and so forth)

    the rotation matrix that autocad uses isn't so much a rotation operation as
    it is a translation of coordinates which is rotated by the translation.

    HTH,

    Devin
     
    Devin, Jun 15, 2004
    #2
  3. BillZ

    Devin Guest

    the x unit vector is a vector with a length of 1.0 that points right. The y
    unit vector is a vector with a length of 1.0 that points out. The z unit
    vector is a vector with a length of 1.0 that points up.

    The rotation matrix is a 3x3 matrix portion of the translation matrix. The
    first row of the rotation matrix is the x unit vector and the second is the
    y unit vector and the 3rd is the z unit vector.

    The identity matrix is the WCS. It has an x unit vector that points right
    and a y unit vector that points out and a z unit vector which points up, and
    it is...

    (1 0 0)
    (0 1 0)
    (0 0 1)

    The translation portion of the matrix is the last column in each row and it
    points to the translation that must ocure after the rotation. The first row
    holds the x element of the translation vector, the second row holds the y
    element and the 3rd holds the z element...

    (1 0 0 tx)
    (0 1 0 ty)
    (0 0 1 tz)

    The last row or fourth row of the transformation matrix has to do with
    perspective. I haven't dug into that portion yet. The rotation matrix is a
    3x3 matrix and the final transformation (complete and the one that autocad
    uses) matrix is a 4x4 and the identity of that or wcs is...

    (1 0 0 tx)
    (0 1 0 ty)
    (0 0 1 tz)
    (0 0 0 1)

    I found a really good guide on this subject but I'm having trouble finding
    it again. The funny thing is that game developers use this technology quite
    a bit. You'll find most of the resources there.

    HTH,

    Devin
     
    Devin, Jun 15, 2004
    #3
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.