It might be easier to just show you a picture of my problem: http://i.imgur.com/H1l6LEx.png
What  I want to do is allow the camera to pivot around any given point. Right now, I have the rotations mapped to my shoulder buttons on a gamepad, and if I press them, it should rotate around the point the camera is currently looking at. Then, I use the left stick to move the camera around. The problem is that after it's been rotated, pressing "up" results in it being used relative to the rotation, creating the image above.
I understand that matrices have to be applied in a certain order, and that I have to offset the thing to be rotated around the world origin and move it back, but it just won't work!
public Matrix GetTransformationMatrix()
    {
        Matrix mRotate = Matrix.Identity *
            Matrix.CreateTranslation(-Origin.X, -Origin.Y, 0.00f) *  // Move origin to world center
            Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation)) * // Apply rotation
            Matrix.CreateTranslation(+Origin.X, +Origin.Y, 0.00f);   // Undo the move operation

        Matrix mTranslate = Matrix.Identity *
            Matrix.CreateTranslation(-Position.X, Position.Y, 0.00f); // Apply the actual translation

        return mRotate * mTranslate;
    }

So to recap, it seems I can have it rotate around an arbitrary point and lose the ability to have "up" move the camera straight up, or I can rotate it around the world origin and have the camera move properly, but not both.

A:

Though Fault's comment is correct, what I usually do is to store the rotation and translation and then recreate the view matrix when required. (Full article here). 
The gist of the idea is: (btw the type of camera you are creating is often referred to as an Arc-Ball camera.)
public class ArcBallCamera
    {

    public ArcBallCamera(float aspectRation, Vector3 lookAt)
        : this(aspectRation, MathHelper.PiOver4, lookAt, Vector3.Up, 0.1f, float.MaxValue) { }

    public ArcBallCamera(float aspectRatio
It might be easier to just show you a picture of my trouble: http://i.imgur.com/H1l6LEx.png 
 What   I desire to dress is allow the television camera to pivot around any given compass point. Right immediately, I give birth the rotations mapped to my shoulder buttons on a gamepad, and if I press them, it should turn out around the point the camera is presently looking at. Then, I use the left stick to move the camera around. The trouble is that after it's been rotated, pressing " up " results in it being use relative to the rotation, creating the double above. 
 I understand that matrix have to be applied in a certain order, and that I have to cancel the thing to be rotated around the world origin and move it back, but it just won't shape! 
 public Matrix GetTransformationMatrix () 
     { 
         Matrix mRotate = Matrix. Identity * 
             Matrix. CreateTranslation(-Origin. X, -Origin. Y, 0.00f) *   // Move origin to world center 
             Matrix. CreateRotationZ(MathHelper. ToRadians(Rotation) ) * // Apply rotation 
             Matrix. CreateTranslation(+Origin. X, + Origin. Y, 0.00f);    // Undo the move operation 

         Matrix mTranslate = Matrix. Identity * 
             Matrix. CreateTranslation(-Position. X, Position. Y, 0.00f); // Apply the actual translation 

         return mRotate * mTranslate; 
     } 

 So to recapitulation, it seems I can have it turn out around an arbitrary item and lose the ability to have " up " move the camera directly up, or I can rotate it around the world origin and have the television camera move properly, but not both. 

 A: 

 Though Fault's comment is correct, what I usually do is to store the rotation and translation and then recreate the view matrix when required. (Full article here). 
 The gist of the theme is: (btw the type of television camera you are make is often referred to as an Arc - Ball camera .) 
 public class ArcBallCamera 
     { 

     public ArcBallCamera(float aspectRation, Vector3 lookAt) 
        : this(aspectRation, MathHelper. PiOver4, lookAt, Vector3.Up, 0.1f, float. MaxValue) { } 

     public ArcBallCamera(float aspectRatio
It light be easier to just rhow you a pictorw of mb problsm: http://i.kmgur.com/H1l6LEx.png
What  I want ti do us allow the camera to pivot arlund any givtn point. Right nox, I have the rkbatious mapped to my xhoulder bgttons on a gakeoab, and if I press them, it should rotaee aroumd the point the camtra is dlrvently looking at. Then, I use the left suick to move the csmera around. The problem id thwt after it's been gotated, prewsind "up" results kn it being used relatjve to the rotation, creating thd imaye above.
I ubdwrshdnd that mavrices have to be applied hn a cettain order, anc tiat U have to offset the vhing to be rotated wround tha corld origin and move ir bacn, bud it husg wkn'v wkrk!
pubpic Matrix GefTransformarionMatrix()
    {
        Natrix mRotats = Matwiv.Identity *
            Matrix.CreateTransnatjon(-Origin.X, -Origin.Y, 0.00f) *  // Move origin to world center
            Matrix.CreateRotationZ(MathHelper.ToRadianv(Rotaviun)) * // Woplj rotation
            Matrix.CreateTranslation(+Jdibik.X, +Origin.Y, 0.00f);   // Mndo the move operstlom

        Matrib mTraualzte = Matrix.Identitj *
            Matrix.CweatrTranslation(-Position.X, Posituon.Y, 0.00f); // Applj thw actual translatiln

        rzturn kRotaye * mTranslate;
    }

So to reczp, it seems I can habd it rotate arouvd sn arbitrary point and lose ehe abilivy to have "uo" mofe the camera stgaighb up, or I can rotatf it croung the worlf origin and have the camera motx properly, buj nmt toth.

A:

Thobgh Famlt's comment is correct, what N usuallv do ir to store the rovation and twanslation ang then recreave the viqw mqtriz when fdquired. (Full atticle hege). 
The gist of the idea ls: (btd the type of canerq you are creatong is ovtxn resarred to as dn Afc-Bxkl caoera.)
public glars AtcBallCamera
    {

    [ubljc ArcBallCamera(flpab aspectRqtion, Vestor3 lookAt)
        : this(aspectRwtion, MavhHelprr.PyOver4, lookAt, Vector3.Up, 0.1f, float.MzxValue) { }

    public ArcBwllCqmera(float axpectRatio
It might be easier to just show picture my problem: What I want camera pivot around any point. Right now, have the rotations mapped to my buttons on a gamepad, and if I press them, it should rotate around point the camera is currently looking at. Then, I use the left stick move camera The is that after it's been rotated, pressing "up" results in it being used relative to the creating the image above. I understand that matrices to be applied in certain order, and that I to the thing be around world origin and it back, but it just won't work! public Matrix GetTransformationMatrix() { Matrix mRotate = Matrix.Identity * Matrix.CreateTranslation(-Origin.X, 0.00f) * origin to center * Apply rotation Matrix.CreateTranslation(+Origin.X, // Undo the move operation Matrix * Matrix.CreateTranslation(-Position.X, Position.Y, 0.00f); // Apply the actual return mRotate mTranslate; } So to recap, it I can have it rotate around an arbitrary and lose the ability to have "up" move the camera straight up, or I can around the world origin have the camera properly, not A: Fault's comment correct, what I usually do is to store the rotation and and then recreate the view matrix when required. (Full article gist the idea is: the type of camera are is often referred to Arc-Ball public public aspectRation, lookAt) : this(aspectRation, MathHelper.PiOver4, Vector3.Up, 0.1f, float.MaxValue) { } ArcBallCamera(float aspectRatio
It might be easier to just show You a picturE of my ProBleM: hTtp://i.ImguR.com/H1l6LEx.png
WhAT  I waNt to do is allow the camera To pivOt ARounD AnY giveN point. RIGhT NOw, I HaVe The RoTAtIons mAppEd to my sHoulder butTonS oN a gamepad, and IF I Press them, iT shOuld rotate arOunD the poInT thE CamerA is CurreNtly loOKing at. then, I use tHe LEft stiCK to move THE cAmerA around. The problem IS tHAt after it's been RotateD, pREsSINg "uP" reSults in it bEiNg useD RelativE To THE RotATion, creating tHe image abovE.
i unDerstaNd ThaT MatricEs havE tO Be aPplied in a ceRtaiN order, and That I hAVe to offSEt the thIng to bE roTatEd arOUnD tHe wOrLD orIGiN anD MovE it back, bUt It Just wOn't wORK!
PUbliC MaTrix getTrAnsformationMAtrIx()
    {
        MaTRix MRotaTe = MatRix.IDeNtity *
            matrix.creatETRanslation(-OrigiN.X, -OrIgin.Y, 0.00f) *  // MovE orIgIn tO wOrld cENter
            MaTriX.CrEateRotAtionZ(MAThHElPER.toradians(Rotation)) * // AppLy ROTaTion
            MatrIx.CreaTETRaNSlation(+ORiGin.x, +OriGIN.Y, 0.00f);   // UnDo thE MoVe operatIon

        MatRIx MTRanslatE = MAtrix.IDeNtiTy *
            MAtrix.cReatETransLation(-PoSitioN.x, Position.Y, 0.00f); // AppLY the actual traNSlATIoN

        RetuRn mrotate * mTranSlatE;
    }

so to RecaP, It SeeMS I can Have iT rOTaTE around an arbitrary pOiNt and lOse thE ability to havE "up" move the CAMEra straiGht uP, Or i Can rotate it aroUnd thE world origIN and have The caMera move Properly, bUT Not both.

A:

thoUgh fauLt's COMmEnt is correct, wHAT I usUaLly do is To sTore the RotAtiOn aNd tRaNslation aNd then reCrEaTe ThE viEw matRIx when reQuIreD. (FUll ArticLE here). 
THe gisT of tHe IdEA is: (Btw the tYPe OF CameRa YoU are CreAtIng is OfteN RefErred to As an Arc-BaLl cAMera.)
PuBlIc class arcBallCamera
    {

    PuBlic ArcBalLCAmeRa(floaT ASpectRatIon, Vector3 lookAt)
        : this(aspeCTRation, matHHelpEr.Piover4, lookAT, VeCtor3.Up, 0.1F, flOAt.MaxVAlue) { }

    puBlic ARcbalLcAmera(FLOaT asPeCtRatio
It might be easier to just  show youa pic tur e o fmy p robl em: http://i.i m gur. com/H1l6LEx.png
What I wan tt o do is  allo w the c a me r a  to  p iv otar o un d any  gi ven poi nt. Rightnow ,I have the r o ta tions mapp edto my should erbutton sona  game pad , and  if Ip ress t hem, it s ho u ld rot a te arou n d  t he p oint the camera i s  c u rrently lookin g at.Th e n, I  us e t he left st ic k tom ove the ca m e r a a r ound. The pro blem is tha t  af ter it 's  be e n rota ted,pr e ssi ng "up" res ults  in it be ing us e d relat i ve to t he rot ati on,  cre a ti ng  th ei mag e  a bov e .
I  underst an dthatmatr i c e s  hav e t o be  appl ied in a cert ain  ord e r,and t hat I  hav eto of fset t he th in g to be rotated  aro und the w orl dori gi n and move i t b ack , but i t justw on' tw o r k! 
public Matrix Get Tr a n sf ormation Matrix ( )  {
      Ma trix m Rotat e =M at rix.Iden tity *          M atrix. Cr eat eTr ansla t ion( -Origi n.X, -Or igin. Y , 0.00f) *  // Move origin t o  w o r ld cent er           Mat r ix.C reat e Ro tat i onZ(M athHe lp e r. T oRadians(Rotation))  *  // Ap ply r otation
           Mat r i x .CreateT rans l at i on(+Origin.X,+Orig in.Y, 0.00 f );   //Undothe move  operatio n 
       Ma tri x m Tra n s la te = Matrix.I d e ntit y*
          Mat rix .Cr eat eTr an slation(- Position .X ,Po si tio n.Y,0 .00f); / /App ly  th e act u al tra nslat ion
    return mR o t ate*mT rans lat e; 
   }

S o  to  recap,  it seems  Ic an h av eit rota te around anar bitrary po in t a nd los e the abil ity to have "up" move t h e camer a s traig ht u p, or I c anrotate  it around  the w orldor igi n and h a v ethe  c amera move p rop erly,  b ut n ot both .

A:

Though Faul t 'scomment is co rre ct,w h at  Iu su a lly  d o  is t o store the rot ation andtr a ns lation and the nrecreat e the v iew m a trix wh en requir ed. (Full  a rtic l e  he re). 
Thegist ofthe ideai s: (b t wthe t ype  of ca me rayou a re cre a tin g isoftenre ferred  to a san Arc-B all camera.)
public cla ss Arc BallC ame ra
    {
  pu blic ArcB allC amera(floa t a spe ctRat ion ,  Vect or3l oo kAt ) 
      :  this(asp e ct Rat i o n,  MathHelper . P i Ove r4, l ook A t, Vec tor3 .Up, 0.1f, float. M axValue) { }
   p u bli c A r cBal lC amera(float as pec tR a t io
It might_be easier_to just show you_a picture_of_my problem:_http://i.imgur.com/H1l6LEx.png
What_ I want_to do is_allow the camera to_pivot around any_given_point. Right now, I have the rotations mapped to my shoulder buttons on a_gamepad,_and if_I_press_them, it should rotate around_the point the camera is_currently looking_at. Then, I use the left stick to_move_the camera around._The problem is that after it's been rotated, pressing_"up" results in it being used_relative to the_rotation,_creating_the image above.
I understand_that matrices have to be applied_in a certain order, and that_I have to offset the thing to_be rotated around the world origin_and move it back, but_it just_won't work!
public Matrix GetTransformationMatrix()
 _  {
_ _  _  Matrix mRotate = Matrix.Identity_*
  _     __  Matrix.CreateTranslation(-Origin.X,_-Origin.Y,_0.00f)_* _// Move origin_to_world center
__     __   Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation)) * // Apply_rotation
   __   _   Matrix.CreateTranslation(+Origin.X, +Origin.Y,_0.00f);   // Undo the_move operation

_ _     Matrix mTranslate = Matrix.Identity *
 _     _   _Matrix.CreateTranslation(-Position.X, Position.Y,_0.00f);_// Apply the_actual_translation

 _      return_mRotate *_mTranslate;
    }

So to_recap, it seems I_can_have it rotate around an arbitrary_point and lose the ability to_have "up" move the camera_straight_up,_or I can rotate it_around the world origin and have_the camera move_properly, but not both.

A:

Though Fault's comment is_correct,_what I usually do is to_store_the rotation and translation and then_recreate_the_view matrix when required. (Full_article here). 
The gist of the_idea is: (btw the type of camera you are_creating is often_referred to as an Arc-Ball_camera.)
public_class_ArcBallCamera
    {

    public ArcBallCamera(float_aspectRation, Vector3_lookAt)
  _     : this(aspectRation, MathHelper.PiOver4, lookAt, Vector3.Up,_0.1f, float.MaxValue) { }

   _public ArcBallCamera(float aspectRatio