Twisted MS to PS

Discussion in 'AutoCAD' started by d2cad, Mar 26, 2005.

  1. d2cad

    d2cad Guest

    I have a LISP which transforms a MS-point to a PS-point and uses this to insert a block in PS. This only works when the viewport is 'normal'. Now I want to make it work when the viewport is rotated (DVIEW - TWIST - 90). Now I get the same points as when the viewport wasn't twisted.
    For the old LISP I used (trans mspoint 2 3) to get from MS to PS. Any-one have any ideas on how to twist PS to get the points right???

    Jeroen
     
    d2cad, Mar 26, 2005
    #1
  2. d2cad

    James Allen Guest

    Hi Jeroen,

    I haven't dealt with this specific situation myself, but... you might get
    lucky and this work. If all your resulting point is lacking is the final
    rotation about the origin, then this pair of formulas should be all you
    need:
    x = x cos(r) - y sin(r)
    y = x sin (r) + y cos(r)

    This assumes everything involved is 2D (or at least viewdir = 0,0,1). I'm a
    little surprised that trans doesn't take care of that, but not too much. If
    that isn't all it needs, you might have to calculate the whole
    transformation yourself with raw information, but again, I haven't looked at
    this particular situation in depth myself. If you need more help, posting
    your code would be helpful to someone trying to help you.

    --
    James Allen, EIT
    Malicoat-Winslow Engineers, P.C.
    Columbia, MO


    insert a block in PS. This only works when the viewport is 'normal'. Now I
    want to make it work when the viewport is rotated (DVIEW - TWIST - 90). Now
    I get the same points as when the viewport wasn't twisted.
    have any ideas on how to twist PS to get the points right???
     
    James Allen, Mar 27, 2005
    #2
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.