I Can't get correct rotations for cubemap faces. Thats should come to geometry shader, from camera "view" matrix I want make 6 faces for my cubemap, but seems I can't get it correctly...
My first guess that camera 'indent' matrix faces to '-z':
// +X //
rot[0] = (mat4 ( 0 , 0 , -1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
1.0 , 0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
// -X /
rot[1] = (mat4 ( 0 , 0 , 1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
-1.0 , 0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//+Y/
rot[2] = (mat4 ( 1 , 0 , 0 , 0 ,
0 , 0 , 1.0 , 0 ,
0 , -1.0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//-Y/
rot[3] = (mat4 ( 1 , 0 , 0 , 0 ,
0 , 0 , -1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//+z/
rot[5] = (mat4 ( -1 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 ,
0 , 0 , -1 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//-z/
rot[4] = (mat4 ( 1 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 ,
0 , 0 , 1 , 0 ,
0 , 0 , 0 , 1.0 )) ;
EDIT: Correct for me: Using LookAt magic, finaly find correct order of rotation: NOTE: thats RH-coordinate system Column-major order (glsl default)
// +X
rot[0] = (mat4 ( 0 , 0 , 1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
-1.0 , 0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
// -X /
rot[1] = (mat4 ( 0 , 0 , -1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
1.0 , 0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//+Y/
rot[3] = (mat4 ( -1 , 0 , 0 , 0 ,
0 , 0 , -1.0 , 0 ,
0 , -1.0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//-Y/
rot[2] =(mat4 ( -1 , 0 , 0 , 0 ,
0 , 0 , 1.0 , 0 ,
0 , 1.0 , 0 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//+z/
rot[4] = (mat4 ( -1 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 ,
0 , 0 , -1 , 0 ,
0 , 0 , 0 , 1.0 )) ;
//-z/
rot[5] = (mat4 ( 1 , 0 , 0 , 0 ,
0 , 1 , 0 , 0 ,
0 , 0 , 1 , 0 ,
0 , 0 , 0 , 1.0 )) ;