Advertisement
abraao

camera

Nov 4th, 2015
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1.     //Camera
  2.  
  3.     Vertice cam_Posicao(0, 0, 5);
  4.     Vertice cam_LookAt(0, 0, 0);
  5.     Vertice cam_Up(0, 1, 0);
  6.  
  7. Vertice cam_Z = (cam_Posicao - cam_LookAt) / cam_Z.normaVetor(cam_Posicao - cam_LookAt);
  8.  
  9.  
  10. Vertice cam_X = cam_X.prodVetorial(cam_Up, cam_Z) / cam_X.normaVetor( cam_X.prodVetorial(cam_Up, cam_Z) );
  11.  
  12.  
  13. Vertice cam_Y = cam_Y.prodVetorial(cam_Z, cam_X) / cam_Y.normaVetor(cam_Y.prodVetorial(cam_Z, cam_X));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement