cebugdev2 said:
i have a bounding box and the orientation of an object without the transform matrix,
Sounds you are maybe unaware that you do have the transformation matrix?
cebugdev2 said:
I have the orientation of the model such as its position, right, up and look/forward vector,
That's all a transform matrix is. The matrix would then be simply:
struct Matrix4x4
{
vec4 front;
vec4 up;
vec4 right;
vec4 position;
};
Matrix4x4 mat;
mat.front = vec4(forward, 0); // assuming your forward is a vec3, we set the 4th. element to 0 for vectors
mat.up = vec4(up, 0);
mat.right = vec4(right, 0);
mat.position = vec4(position, 1); // we set the 4th. element to 1 for points
The same works if your matrix has member data like ‘vec4 columns[4]’ or just ‘float numbers[4][4]’. Just replace names with indices in proper order.
There is however a pitfall with row major vs. column major conventions, so you eventually need to flip indices from numbers[a][b] to numbers[b][a].
I guess you knew this already, but if not it's really important to understand and work with transformation matrices.
cebugdev2 said:
I want to orient the bounding box on the axis of the bracket,.
You would then transform the tooth vertices from local space of the teeth to the local space of the bracket first. This can be done in two ways:
Transform vertices to world space, then transform them to object space of the bracket,
or make a transform matrix from one local space to the other and transform the vertices just once after that.
Still confused if that's you question, though.