Question: Use GLM to determine your solution. You don't need to render anything. Just print to the console Show your work! Consider 2 cubes: These cubes

Use GLM to determine your solution. You don't need to render anything. Just print to the console Show your work! Consider 2 cubes: These cubes are the same size. They do not have transformations applied to them. Instead the vertices are defined such that they define the cubes at each position/orientation. Here are 4 vertices for each cube. C Goal: figure out the transformation to align cube1 to cube2 1) Create a frame (i.e., 3 orthogonal axes and a position) for each cube. Write the 3 axes for each cube: right, up, forward. Remember to normalize each axis! a) Make 2 vectors from 3 points, make sure to normalize. take the cross product to get an orthogonal vector. Take the cross product with that vector and one of the other ones. b) Maker 3 vectors from the vertices 2) Assign values from vectors to matrix locations. (Remember position w is 1.0 whereas vector w is 0.0) Print out your 2 matrices. 3) Use matrix algebra and inversion to calculate the transformation to align cube1 to cube2. (HINT: Remember M1X=M2;X=M11M2 ) Print out the final transformation matrix ( X in the above equation)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
