This is my submission for Project 1 – Interactive 2D Geometry.
This project implements an interactive OpenGL application. Users can move, scale, and rotate a textured square loaded from a PPM image. Pressing ‘r’ resets the square to its initial state.
Translating only when the user drags inside the square (not edges)
Scaling the square when dragging from corners
Rotating the square when dragging from edges
Before applying texture:
Before brightening:
After brightening:
Background color change triggered by keyboard input
Toggling between triangle and square shape
Animation triggered by holding down the 'M' key
Square keeps its shape when window is resized
While completing Project 1 I encountered several challenges related to animation logic, shape control, optimization of the initial approach, and real-time input handling. One difficulty was accounting for all edge cases when designing the logic for smooth scaling and rotation. Although the initial setup was straightforward, debugging and improving interactivity took considerable time. Another issue was getting the animation to run smoothly without relying on continuous mouse or key input, which required understanding SDL’s event loop and decoupling logic from frame-based input. Maintaining a perfect square shape during window resizing was also tricky and required correcting for aspect ratio distortion. Texture mapping using a PPM file and applying a brightening effect without color distortion introduced challenges with pixel-level image handling. Finally, due to GitHub’s file size limitations, I had to convert large `.gif` files into `.mp4` and host the code externally via Google Drive for submission. These difficulties gave me deeper insight into OpenGL rendering, coordinate transformations, and deployment workflows.