I guess you have MVP matrix in shader and you need these matrices
1. [M] Model transform comes from node element
2. [V] Camera transform comes from node element. View matrix is inverse of this.
3. [P] Projection matrix comes from camera element
But how to add rotation???
This is same as how to add rotation to model matrix. You can construct a matrix using those individual transforms like this:
Pseudo Codes:
mat4 matrix = GLM_MAT4_IDENTITY_INIT; // Node local transform
while (transform) {
switch (transform->type) {
glm_translate(matrix, ((Translate)transform)->translate);
glm_rotate(matrix, ((Rotate)transform)->rotate, ((Rotate)transform)->angle);
transform = transform->next;
}
View matrix is inverse of the camera's world transform. After built matrix like above then the VIEW matrix is inverse of that matrix. You don't need to lookat except if it appears in a node instead of other transforms.
This is local transform (relative to its parent) if you need to world transform (relative to origin) you need to multiply it with parent recursively