Lab: Stick Shift
In this chapter, you've been learning about the graphics pipeline, the series of computational hurdles that geometry must overcome before landing in the framebuffer. You'll continue exploring these hurdles as you build a scene arranger. The user inserts and arranges models in the world using a gamepad.
Requirements
Your challenge is to build a renderer with a customizable scene arranger. Follow these steps:
Clone an existing renderer into a new renderer named
stick-shift
.
Investigate the Gamepad API. In particular, find out how to detect if a button is pressed or the joystick is moved.
Consult a gamepad tester to identify button and axis indices.
When a button of your choice is pressed, insert a new instance of a model at some central location. Allow for an arbitrary number of models to be inserted. Feel free to vary the models or just stick with one.
When the left joystick is moved, shift the most recently added model in the xz-plane.
When the right joystick is moved vertically, shift the most recently added model along the y-axis.
When the right joystick is moved horizontally, rotate the most recently added model about its model space y-axis.
Submission
To receive credit for your lab work, follow these steps:
Non-host, download the
stick-shift
folder before the host closes the session.
Share a video of your animated model in a post in the
#lab
channel in Discord. No voiceover is necessary. Tag your group members with @
.
Push your code to your individual GitHub repository that your instructor made for you.
Only labs submitted on time will be granted credit. Late labs or forgot-to-submits are not accepted because Monday at noon is when your instructor has time to grade.