# PVRTMat4::LookAtRH \* transformation \* rotation question

**URL:** <https://forums.imgtec.com/t/pvrtmat4-lookatrh-transformation-rotation-question/1608>\
**Category:** PowerVR Insider\
**Created:** [December 12, 2012, 3:45pm UTC](https://forums.imgtec.com/t/pvrtmat4-lookatrh-transformation-rotation-question/1608 "2012-12-12T15:45:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev2rights](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/dev2rights/32/173_2.png) [@dev2rights](https://forums.imgtec.com/u/dev2rights)\
**Post date:** [December 12, 2012, 3:45pm UTC](https://forums.imgtec.com/t/pvrtmat4-lookatrh-transformation-rotation-question/1608/1 "2012-12-12T15:45:27Z")

</div>

Hello,  
  
  
  
Im having some trouble moving around a scene and have got a bit stuck. I create a projection matrix up for the " Camera " and multiply the models by this matrix to put them over the same space for each frame.  
  
  
  
PVRTVec3 vFrom( 0, 8, 20 ), vTo( 0, 0, -20 ), vUp(0.0f, 1.0f, 0.0 );  
  
m\_mProjection = PVRTMat4::LookAtRH(vFrom, vTo, vUp) \* PVRTMat4::RotationY( DEGREES\_TO\_RADIANS( m\_WorldRot ));  
  
  
  
But when i increment / decrement m\_WorldRot it seems to rotate the projection around the origin of 0,0,0 and not the vector vFrom of vTo.  
  
  
  
I want to rotate around the new look at point. What am i doing some thing wrong here ?

---

<div class="post-metadata">

**Author:** ![dev2rights](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/dev2rights/32/173_2.png) [@dev2rights](https://forums.imgtec.com/u/dev2rights)\
**Post date:** [December 13, 2012, 4:32pm UTC](https://forums.imgtec.com/t/pvrtmat4-lookatrh-transformation-rotation-question/1608/2 "2012-12-13T16:32:38Z")

</div>

I figured it out, as the matrices orient around the origin i needed to use Eulers theorem and translate the projection back to 0,0,0 then rotate and translate back to the world position. I should have known this as i did asteroids ages ago.

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [December 14, 2012, 9:33am UTC](https://forums.imgtec.com/t/pvrtmat4-lookatrh-transformation-rotation-question/1608/3 "2012-12-14T09:33:57Z")

</div>

Hi Dev2Rights,  
  
  
  
You should refer to the Model View Project matrix calculations in one of our Examples (such as IntroducingPOD) for a clean, simple way of setting up the matrices in your scene.  
  
  
  
Regards,  
  
Joe
