Lawrence Roberts used homogeneous coordinates for 3D graphics in his 1963 MIT thesis; he later managed the ARPANET program.Roberts, Machine Perception of Three-Dimensional Solids, MIT, 1963
Build the four elementary matrices by hand, see that order is the operation (T · S and S · T differ in their translation column), rotate about a pivot with the sandwich T(p) · R · T(−p), invert a rigid transform with a transpose, and then run the robot arm of the scene-graph demo through Wchild = Wparent · Lchild. The runner places the three boxes with your world matrices only.
| JavaScript | C# | What it computes |
|---|---|---|
translation, rotationY, rotationZ, scaling | Translation, RotationY, RotationZ, Scaling | The four elementary 4 × 4 matrices (rotations right-handed, degrees). |
pivotRotateY | PivotRotateY | T(p) · Ry(deg) · T(−p). |
rigidInverse | RigidInverse | [R | t]−1 = [RT | −RTt], for a rotation plus translation. |
localMatrices | LocalMatrices | Lbase = T(0, 0.2, 0) Ry(baseRy); Larm = T(0, 0.2, 0) T(0, armT, 0) Rz(armBend) T(0, 0.7, 0); Lhand = T(0, 0.7, 0) Ry(handRy). |
worldMatrices | WorldMatrices | Wbase = Lbase, Warm = Wbase Larm, Whand = Warm Lhand. |
worldToLocal | WorldToLocal | A world point in the frame of the rigid world matrix W: W−1 p. |
matMul (WebGL) or * (Unity) are allowed; building the factors is the homework.Each row is one check, run on your functions with the published inputs below. The same table appears under the scene in the runner and in the Unity Console.
| # | Check | Expected | Tolerance | Points |
|---|---|---|---|---|
| 1 | T(3,0,0) · S(2,1,1): translation column | (3, 0, 0) | 0.000001 | 8 |
| 2 | S(2,1,1) · T(3,0,0): translation column | (6, 0, 0) | 0.000001 | 8 |
| 3 | pivotRotateY((1.5, 0, 0), 90): translation column (I − R)p | (1.5, 0, 1.5) | 0.001 | 12 |
| 4 | pivotRotateY: the image of the point one unit past the pivot in x | (1.5, 0, -1) | 0.001 | 6 |
| 5 | rigidInverse of T(0,0,−1) · R_y(90): all 16 entries | (0, 0, 1, 0, 0, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 1) | 0.001 | 14 |
| 6 | worldMatrices at baseRy 30, armBend 40: W_hand, 16 entries | (0.6634, 0.6428, -0.383, 0, -0.5567, 0.766, 0.3214, 0, 0.5, 0, 0.866, 0, -0.7793, 1.4725, 0.45, 1) | 0.002 | 20 |
| 7 | hand origin in world space | (-0.7793, 1.4725, 0.45) | 0.002 | 8 |
| 8 | arm origin in world space | (-0.3897, 0.9362, 0.225) | 0.002 | 8 |
| 9 | worldToLocal: world point (0, 1, 0) in the hand frame | (0.3857, -0.9404, 0) | 0.002 | 16 |
{
"order": {
"s": [ 2, 1, 1 ],
"t": [ 3, 0, 0 ]
},
"pivot": {
"p": [ 1.5, 0, 0 ],
"deg": 90
},
"rigid": {
"ry": 90,
"t": [ 0, 0, -1 ]
},
"pose": {
"baseRy": 30,
"armBend": 40,
"handRy": 0,
"armT": 0
},
"worldPoint": [ 0, 1, 0 ]
}Build each function from primitives (matrix products, applying a matrix to a point, component access, sin and cos.) and use the engine's own helper, where one exists, only to check your result. These are off limits in your submission:
| Track | Off limits |
|---|---|
| WebGL (JavaScript) | makeTRS, axisAngleMatrix, invertTRS from xform.js; THREE.Matrix4.invert, makeTranslation, makeRotationY, makeRotationZ, makeScale, compose; Object3D parenting. |
| Unity (C#) | Matrix4x4.TRS, Translate, Rotate, Scale, .inverse; Transform parenting; TransformPoint, InverseTransformPoint. |
git clone https://github.com/mgav-uwb/UWB-CSS-551-AU26-homework.git, or Code, then Download ZIP. It gains each homework the day it goes out; git pull fetches it.python3 -m http.server 8000 and open http://localhost:8000/homework/run.html?hw=hw03.lib/skeletons/hw03.js, the only file you change, and reload: the Checks table under the scene compares your numbers with the ones below.The unfilled skeleton runs on this site too, so you can see the page before you start. The setup, the blank page a file opened from disk gives, and how to read the Checks table are in WebGL and three.js for This Course.
homework/hw03/unity/ into Assets/HW03/.Checks component (namespace CSS551.HW03), and press Play: the Console lists every check with your value and the expected one.HW03.cs; the other files are given.The Unity files compile against a stand-in for the UnityEngine API and pass their checks with the reference solution, but they are new this quarter and have not yet been opened in the Unity editor. If one does not compile in 6000.3.11f1, post the error on the Canvas board and use the WebGL track meanwhile.
hw03.js.Library/, Temp/, Logs/ and obj/.Grading runs your functions twice: on the published inputs above and on a second set of inputs that is not published. A check earns its points only when your value is within its tolerance on both, so the numbers have to come from the math. The rubric score is the sum of the points earned, out of 100; it counts as 25 course points (the rubric score divided by 4). A submission that does not load or compile earns no check points. Name any collaborators and tools in the submission comment.