Get cube points after transformations

Hello,

I have created a cube (with known vertices) and i rotate and traslate it. What i lack are the new positions of its vertices after the transformations. So the question is do i have to find the transformation matrix on paper in order to calculate the vertices, or there is some function to get them?

Thanks in advance

Why do you need the translated vertices?

I try to implement the separating axis theorem for some oriented bounding boxes (cubes in my case). So i need the unit vectors that represent the 3 local axis of each box. To find these unit vectors i subtract the vertices to get the vectors and then i normalize them. And that’s where i stuck because i have to know the positions of the vertices after the transformations.

[QUOTE=Barbarosa;1252276]… i have to find the transformation matrix on paper in order to calculate the vertices, or there is some function to get them?[/QUOTE] Here’s an example of how I do it using fixed pipeline OpenGL commands only.


void Retrieve_Transformed_Vector (void)
{
    glMatrixMode (GL_MODELVIEW);
    glLoadIdentity ();

    // same modeling transformations that are applied to cube go here. 

    glTranslatef (corner[0], corner[1], corner[2]);

    glGetFloatv (GL_MODELVIEW_MATRIX, transmat);   // read manual on transmat, should be a GLfloat transmat[16]
                                                   // transmat[12],[13],[14] are the new coordinates of corner
}


That’s exactly what i was looking for. Thank you very much!