Augmented Reality (Fall 2022)

HW 5: Clock animation

For this assignment, you are welcome to collaborate with your partner. This assignment is to make an augmented reality clock, with moving hands.  The clock hands should be registered to one of the Vuforia “Mars” image targets.  Make two clock hands by scaling Unity’s “cube” primitives. You should have a short “hour” hand and a long “minute” hand.  The hands should rotate about the center of the image target, like a normal analog clock (see image below).

clock

Attach a (single) script to each hand, that rotates the hand by changing the rotation property of its transform. Note that the hand should rotate about its end, and not its middle. 

Note that you can use the same script for each hand, and simply change the rotation speed using a public variable.

Also, when you hit a key on the keyboard (such as the letter “R”), reset the clock hands to the 12:00 position. To sense a key press, you can use the method you used in the “Roll-a-Ball” tutorial, or an easier method is to use the Unity function “GetKey”.

Capture a short video showing your clock hands in motion.  You should speed up the clock hands so they don’t take so long to go around! For example, have the hour hand make a full rotation in one minute rather than 60 minutes. Of course, the minute hand should go 12 times faster than the hour hand.

Each person should upload a short video showing the operation of the clock, and also the script that you attach to the clock hands.