# Rotating the view around the origin of the world coordinate system

In OpenGL (using shaders), I want to implement a system that will take the user's mouse as input, and then rotate the view about the origin of the rendered scene. So, I need to compute the view matrix (assume the model matrix is identity) that represents this rotation. If the view were to rotate around its own origin, then I could do this by applying a simple rotation operation to the view matrix. However, I don't want to do this -- I want to rotate about the origin of the world coordinate system. So, given a rotation angle "theta", how can I compute this matrix? Thanks!

• In which language is this? – tkausl Jul 30 '15 at 12:53
• I am writing OpenGL code in C++. – Karnivaurus Jul 30 '15 at 12:54

I would recommend you use the mat-library glm and something like the following:
double theta = glm::radians(90);