GUI using C++ and QtYHL 1 ECE 462 C++ and Java Lab Exercise 03 Graphical User Interface using C++ and Qt Yung-Hsiang Lu yunglu@purdue.edu GUI using C++ and QtYHL 2 Install Qt in Your Computer GUI using C++ and QtYHL 3 GUI using C++ and QtYHL 4 GUI using C++ and QtYHL 5 Scroll Down GUI using C++ and QtYHL 6 Install Qt in Linux GUI using C++ and QtYHL 7 for Linux GUI using C++ and QtYHL 8 Install in Linux GUI using C++ and QtYHL 9 GUI using C++ and QtYHL 10 GUI using C++ and QtYHL 11 GUI using C++ and QtYHL 12 GUI using C++ and QtYHL 13 installation complete GUI using C++ and QtYHL 14 execute Qt designer GUI using C++ and QtYHL 15 GUI using C++ and QtYHL 16 To compile a Qt program: 1. qmake -project 2. qmake 3. make GUI using C++ and QtYHL 17 GUI using C++ and QtYHL 18 Install Qt in Windows GUI using C++ and QtYHL 19 Install in Windows GUI using C++ and QtYHL 20 GUI using C++ and QtYHL 21 GUI using C++ and QtYHL 22 GUI using C++ and QtYHL 23 GUI using C++ and QtYHL 24 GUI using C++ and QtYHL 25 GUI using C++ and QtYHL 26 GUI using C++ and QtYHL 27 GUI using C++ and QtYHL 28 GUI using C++ and QtYHL 29 GUI using C++ and QtYHL 30 GUI using C++ and QtYHL 31 GUI using C++ and QtYHL 32 GUI using C++ and QtYHL 33 GUI using C++ and QtYHL 34 GUI using C++ and QtYHL 35 GUI using C++ and QtYHL 36 GUI using C++ and QtYHL 37 GUI using C++ and QtYHL 38 GUI using C++ and QtYHL 39 Qt Documentation GUI using C++ and QtYHL 40 GUI using C++ and QtYHL 41 GUI using C++ and QtYHL 42 GUI using C++ and QtYHL 43 GUI using C++ and QtYHL 44 GUI using C++ and QtYHL 45 GUI using C++ and QtYHL 46 Sample Qt Program GUI using C++ and QtYHL 47 GUI using C++ and QtYHL 48 GUI using C++ and QtYHL 49 GUI using C++ and QtYHL 50 GUI using C++ and QtYHL 51 1. qmake –project 2. qmake 3. make executable GUI using C++ and QtYHL 52 GUI using C++ and QtYHL 53 Develop Qt Project in Netbeans GUI using C++ and QtYHL 54 GUI using C++ and QtYHL 55 GUI using C++ and QtYHL 56 GUI using C++ and QtYHL 57 GUI using C++ and QtYHL 58 GUI using C++ and QtYHL 59 GUI using C++ and QtYHL 60 GUI using C++ and QtYHL 61 GUI using C++ and QtYHL 62 GUI using C++ and QtYHL 63 Add Buttons and Labels GUI using C++ and QtYHL 64 GUI using C++ and QtYHL 65 GUI using C++ and QtYHL 66 GUI using C++ and QtYHL 67 GUI using C++ and QtYHL 68 GUI using C++ and QtYHL 69 Handle User Inputs (Signals) GUI using C++ and QtYHL 70 signal = event (in Java) slot = handler GUI using C++ and QtYHL 71 GUI using C++ and QtYHL 72 Add Paddles and a Bouncing Ball GUI using C++ and QtYHL 73 GUI using C++ and QtYHL 74 GUI using C++ and QtYHL 75 GUI using C++ and QtYHL 76 GUI using C++ and QtYHL 77 GUI using C++ and QtYHL 78 GUI using C++ and QtYHL 79 GUI using C++ and QtYHL 80 GUI using C++ and QtYHL 81 GUI using C++ and QtYHL 82 Move Ball Track Mouse Detect Collision GUI using C++ and QtYHL 83 Law of Reflection • S: surface of collision • N: normal vector, N ⊥ S • I: incident vector • R: reflection vector • a: angle between I and N • b: angle between R and N • law of reflection: a = b • If N, I, and R are unit vectors (|N| = |I| = |R| = 1), R - I = 2 N ⋅ (-I), here ⋅ is the inner product. ⇒ R = I - 2 N ⋅ I ab N S IR GUI using C++ and QtYHL 84 Ball Hits Paddle • Both are circles. The normal vector is the vector connecting the center of the ball and the center of the paddle. • Collision occurs when the distance between the two centers is smaller than the sum of the radii. N GUI using C++ and QtYHL 85 GUI using C++ and QtYHL 86 GUI using C++ and QtYHL 87 GUI using C++ and QtYHL 88 GUI using C++ and QtYHL 89 GUI using C++ and QtYHL 90 Exercise Requirements 1. Make the right paddle follow the ball's vertical coordinate. 2. Detect collision between the right paddle and the ball and make the ball bounce. 3. Update the ball's position and direction. GUI using C++ and QtYHL 91 Submission: A zip file of the CVS repository Remember to commit all changes first. Submit this exercise only. Do not submit any other exercise. Do not submit a wrong zip file.