SIT204 Maths and Physics for Games | 2017 Assignment โ€“ Modelling Task Deadline: 5:00 PM Friday 26th May, 2017 (end of week 11) Instructions There are two parts to this assignment. Part 1 is a compulsory question that all students must complete and is worth 30 points. Part 2 provides several questions and students must complete one (1) of these questions (20 points). You must complete a report containing your solutions to question 1, and one of questions 2 โ€“ 4. Please read the later section regarding submission requirements. The questions in this assignment refer to an animation of a goblin bombardier. The video files for this animation are provided on CloudDeakin, under the Resources->Assessment->AssignmentModelling Task->Goblin Animations folder. You should review these videos to gain an understanding of the animated scene and to help in your interpretation of the questions below. Part 1 (30 points) Question 1 You are to create a mathematical model of the motion of the fire pot as it is swung in a circle by the goblin. Your model must describe the trajectory of the fire pot in the camera frame of reference: that is, provide and equation for the displacement of the fire pot, as a function of time ๐‘ก, the initial conditions of the motion and the rotation speed, ๐œ” (in revolutions per second), relative to the origin of the camera frame. Consider the diagram below, which shows quantities relevant to the mathematical description of the problem. ๐ง เท ๐ฎ เท ๐ง เทร—๐ฎ เท ๐ซ(๐‘ก) ๐ฏ(๐‘ก) ๐‘ƒ ๐ถ ๐ซ เทœ ๐ แˆ˜ ๐Ÿ แˆ˜ SIT204 Maths and Physics for Games | 2017 You must provide a derivation of your model - not simply a statement of the final equations - using the mathematics covered in this unit. Your derivation should contain all relevant mathematical working, and any necessary explanation of methods or algorithms as appropriate. It is suggested that you implement the following procedure to develop your model: 1) Create a coordinate system aligned to the plane of rotation. a. Define the coordinates of the center of rotation, ๐ถ, such that is between 1 and 1.5 meters above the ground (and located anywhere in the XY plane). b. Define a unit normal vector to the plane of rotation, ๐ง เท. c. Determine a vector ๐ฎ เท that lies in the plane of rotation, that is both orthogonal to ๐ง เท and parallel to the ground plane of the world. d. Obtain a third unit vector ๐ฎ เทโŠฅ, that is orthogonal to both ๐ง เท and ๐ฎ เท, such that you have a right-handed orthonormal basis {๐ง เท,๐ฎ เท,๐ฎ เทโŠฅ} aligned to the plane. 2) Determine a counter-clockwise parameterisation of a circle of radius ๐‘Ÿ in your plane. a. Determine a parametric equation (in parameter ๐‘ก) describing the angular position ๐œƒ of point ๐‘ƒ (the position of the firepot) relative to the reference line ๐ฎ เท. This equation should involve the initial angular displacement at ๐‘ก = 0 (i.e., ๐œƒ0) and the angular speed ๐œ”, given in revolutions per second. b. Using the basis vectors {๐ฎ เท,๐ฎ เทโŠฅ}, define the equation of the circle as a vector-valued function in the plane (which should involve angle ๐œƒ). c. Substitute your parametric equation for ๐œƒ(๐‘ก) to obtain coordinates of ๐‘ƒ in the plane, as a function of initial conditions ๐‘Ÿ,๐œƒ0,๐œ” and time ๐‘ก. d. Use your coordinates in the plane to state a vector parametric equation for ๐ซ(๐‘ก), in the basis {๐ง เท,๐ฎ เท,๐ฎ เทโŠฅ}. 3) Obtain a vector-valued equation for the displacement of the firepot, in the camera frame of reference a. Define either a set of equations, or a transformation matrix, to convert vectors from the basis {๐ง เท,๐ฎ เท,๐ฎ เทโŠฅ} to the external basis {๐ข,๐ฃ,๐ค} of the world frame b. Define either a set of equations, or a transformation matrix, to convert vectors from the basis {๐ข,๐ฃ,๐ค} to the basis {๐Ÿ แˆ˜,๐ซ เทœ,๐ แˆ˜}, being the forward, right and down orthonormal basis vectors of the camera frame. c. Define the position of the camera in the world frame and use this to determine a vector ๐œ from the position of the camera to the center of rotation, ๐ถ. d. Convert both vectors ๐œ and ๐ซ(๐‘ก) into the camera frame and add them together, to obtain the equation for the displacement of the point ๐‘ƒ from the origin of the camera frame. Part 2 (20 points) Complete only ONE of the following questions: Question 2: a) Obtain an equation for the trajectory of the firepot, from the moment it is released until it would strike the ground, in the world frame of reference. This will require you to determine the initial conditions for the trajectory (position and velocity in the world frame) using your model developed in Part 1, and then use these to solve for the constants of integration when developing the trajectory equation. SIT204 Maths and Physics for Games | 2017 b) Using your trajectory model, determine the following quantities as functions of the initial conditions (given as variable quantities): 1. maximum height reached by the firepot 2. maximum range of the firepot from the point of release c) Determine the rotation speed and time ๐‘ก of release, such that your model from Part 1 would generate an initial position and velocity that would have the firepot acheive a height of 3 meters at a distance of at least 20 meters from the launch point. Question 3: The ground within the goblin scene is known as a terrain mesh: a set of polygons formed by points (called vertices) that are regularly spaced in their XY coordinates in the ground plane of the world frame, as in the image below (for example). In this problem you are to define a small set of vertices as a section of a terrain mesh. These vertices should be regularly spaced in the XY plane, with varying heights. Create a set of triangles from these vertices and use your points to demonstrate the following: a) Given values for the X and Y coordinates of a randomly chosen location within the boundary of the ground plane under your mesh (not a vertex location of the mesh), determine a method to find the triangle covering this point. Determine the height of the mesh at this location. b) Choose two points on the ground plane under your mesh and define the line (in the XY plane) between these two points. Segment this line into a set of lines that lie under each of the triangles of the mesh above the line (blue segments below). For each line segment, determine the equation of a line in 3D space that lies in the mesh (green segments) and for which its projection into the ground plane is the given blue line segment. SIT204 Maths and Physics for Games | 2017 c) Using your line segments that lie across the mesh, create a plot of height on the line segments above the ground plane, as a function of distance along the line. You should end up with a continuous curve that is piecewise linear. Question 4: Animation of the goblin mesh requires the definition of a skeleton, a set of connected virtual bones. The skeleton is given a bind pose (also called a rest pose), which is usually the pose associated with the character mesh when the character is modelled. This pose may be defined by a set of affine transformations, which are 4ร—4 matrices having the following form: ๐‘€ = [๐‘… ๐ฉ ๐ŸŽ 1 ] where ๐‘… is a 3ร—3 rotation matrix and ๐ฉ is a 3ร—1 column vector. ๐ŸŽ is 1ร—3 row vector of zeros. Affine transformations can be constructed to convert vectors and points from one frame of reference to another. For example, assume that we have two frames ๐ด and ๐ต with origins ๐‘‚๐ด and ๐‘‚๐ต respectively, with ๐‘‚๐ต = ๐‘‚๐ด +๐ฉ being the coordinates of ๐‘‚๐ต relative to ๐‘‚๐ด. Additionally, assume that ๐‘… = [๐› แˆ˜ 1 ๐› แˆ˜ 2 ๐› แˆ˜ 3] where each column is a basis vector for frame ๐ต expressed in the basis of frame ๐ด. Then for any point ๐‘ƒ(๐‘ฅ,๐‘ฆ,๐‘ง)๐ต given in coordinates for frame ๐ต, the coordinates of this point in frame ๐ด are given by ๐‘ƒ(๐‘ฅโ€ฒ,๐‘ฆโ€ฒ,๐‘งโ€ฒ)๐ด = [๐‘… ๐ฉ ๐ŸŽ 1 ][๐‘ƒ๐ต 1 ] = [๐‘…๐‘ƒ๐ต +๐ฉ 1 ] Consider the following diagram depicting part of the goblin skeleton (hips, spine, shoulders, arms), in its rest pose: The red dot represents the origin point of the goblin model. Each green dot represents the origin of the next bone in the skeleton, moving from the center of the goblin outward. The blue dot represents the goblins hand. Each bone has its own frame of reference, such that the origin of a bone has the coordinate (0,0,0) in its own frame. However, each bone origin has a defined position in the frame of reference of its parent bone in a chain. Similarly, the hand has a position in the frame of reference of bone 3 above. If bone ๐‘– has position ๐ฉ๐‘– in the frame of reference of bone ๐‘– โˆ’1 and and the matrix ๐‘…๐‘– has columns that define the basis vectors of this bone, expressed in the basis of frame ๐‘– โˆ’1, then the affine transformation matrix bone 1 bone 0 bone 2 bone 3 SIT204 Maths and Physics for Games | 2017 ๐‘€๐‘– = [๐‘…๐‘– ๐ฉ๐‘– ๐ŸŽ 1 ] can be used to transform the coordinates of points in frame ๐‘– into coordinates of that point in frame ๐‘– โˆ’1. Subsequently, the position ๐ป of the goblinโ€™s hand expressed in the frame of bone 3 can be transformed into the goblins core frame of reference using the transformation sequence [๐ป0 1 ] = ๐‘€1๐‘€2๐‘€3[๐ป 1 ] As an example we can create the first of these matrices as follows: Assume that bone 0 has length ๐ฟ0 and that bone 1 is therefore anchored to bone 0 at position ๐‘‚๐ต1(0,0,๐ฟ0). We could choose a basis for bone 1 as ๐ซ เทœ1 = 0๐ซ เทœ0 +0๐Ÿ แˆ˜0 โˆ’1๐ฎ เท0 ๐Ÿ แˆ˜1 = 0๐ซ เทœ0 +1๐Ÿ แˆ˜0 +0๐ฎ เท0 ๐ฎ เท1 = 1๐ซ เทœ0 +0๐Ÿ แˆ˜0 +0๐ฎ เท0 (which represents a rotation of frame 0 by 90โˆ˜ about the vector ๐Ÿ แˆ˜0). Thus, we obtain the first affine transformation matrix for the above chain as: ๐‘€1 = [ 0 0 โˆ’1 0 0 1 0 0 1 0 0 ๐ฟ0 0 0 0 1 ] Using the above information and examples, complete the following: a) Define the origin point for the goblin model as the point (0,0,0) in the goblin frame of reference and define orthonormal basis vectors for the goblin {๐ซ เทœ0,๐Ÿ แˆ˜0,๐ฎ เท0}, indicating the right, forward and up directions for this core frame. Set these initially to align with the Standard Euclidean basis {๐ข,๐ฃ,๐ค} of the world frame. b) Define the set of transformations ๐‘€1,๐‘€2 and ๐‘€3 for bones 1 to 3 in the chain above. To do so you will need to select coordinates of each bone in its parent bone frame, as well as basis vectors for the bone. To simplify your model, ensure that the actual bone runs in the โ€œupโ€ direction for its frame (i.e., the end point of bone ๐‘– has local coordinates (0,0,๐ฟ๐‘–), where ๐ฟ is the length of the bone, so that this point defines the origin of the next bone in the chain in the current bone frame of reference. Choose appropriate basis vectors so that each bone has a right-handed orthonormal basis. c) Use your transformation hierarchy to compute the position of the goblin hand, relative to the goblin center, in the rest pose. d) Create a new pose for your goblin by adjusting the angle of each arm bone relative to its parent. This will require you to rotate the frame of reference for that bone, to generate a new transform matrix for that bone. e) Using your new pose, compute the new position of the hand of the goblin relative to the goblin center. Submission Requirements You must submit a written report containing all relevant mathematical derivations and explanations for each question answered. Handwritten reports will be accepted, but MUST be legible and neatly laid out. These may be submitted to the Faculty office on your home campus, or mailed to the Unit SIT204 Maths and Physics for Games | 2017 Chair (and must be post-marked no later than the submission deadline). Scanned copies or photographs of handwritten reports will NOT be accepted. It is preferable for students to complete an electronic report using, for example, Microsoft Word. Word provides an equation editor that can be used to neatly write and format mathematical equations. Alternatively reports can be written in LaTeX (see, for example, Overleaf.com for a free online LaTeX editor and compilation system). Students may include hand drawn sketches or graphs in their report as images. Electronic reports must be submitted to the Dropbox on CloudDeakin no later than the deadline given at the top of this document. Late submissions will be penalised in accordance with the SEBE Faculty policy (5% per day up to a maximum of 5 days, after which the mark is 0). You MUST include a fully completed and signed assignment coversheet with your report. Failure to do so will result in a mark of 0 for this task. Marking There is a maximum of 50 points available for this assignment and this task contributes 20% to your final mark in this unit. There is no marking rubric for this assessment task. Points will be awarded for the correctness of the answer(s) given and the clarity of explanation accompanying those answers, which should demonstrate your understanding of the model(s) you have created. Points will be deducted from the maximum available points for a question where there are gaps in the logic, or mathematical working, or where incorrect reasoning or mathematical technique is demonstrated. In cases where a student provides an answer to a question without providing relevant working demonstrating how the answer was constructed, 0 points will be awarded for that question. SHOW ALL RELEVANT WORKING OUT! Extensions Extensions may be granted where a student has suffered a significant illness or hardship, that has negatively impacted their ability to complete this assessment task by the due date. Minor ailments lasting one or two days are insufficient grounds for an extension. To apply for an extension students must complete and submit to the Unit Chair the relevant assignment extension request form available on the SEBE Faculty website for current students. This form must be submitted with a copy of relevant documentary evidence (such as a medical certificate, or letter from a health professional), together with a copy of work completed up to the time at which the application is made. Failing to provide any of these elements of the application will result in the request for an extension being denied. The application MUST be made NO LATER than 12:00 noon on the last day for submissions, being Friday 26th May 2017. Requests after this time will be denied and students will be required to apply to the Faculty for Special Consideration. Academic Integrity Plagiarism and cheating are extremely serious offences that breach academic integrity policies of the Faculty and University. Where it is evident that a student has breached these policies the matter will be referred to the Faculty Academic Progress and Disciplinary Committee (FAPDC) for investigation and possible action.