Add the ability to zoom in and out on the OpenGL screen using touch gestures. This will enhance user interaction by allowing users to explore the starmap more dynamically. The zoom effect will be achieved by modifying the camera's field of view (FOV) based on user input.
Objectives
Implement touch gesture handling (pinch-to-zoom) to detect zoom in/out actions.
Update the OpenGL camera's FOV based on the gesture input.
Ensure smooth transitions for a seamless user experience.
Set minimum and maximum FOV limits to prevent distortion or overly restricted views.
Technical Considerations
Gesture Detection
Surely use Android's ScaleGestureDetector to track pinch gestures.
Map scale factor to a suitable FOV adjustment range.
FOV Modification
Ensure the FOV is clamped to a predefined range (e.g., 30° to 90°) to maintain usability and visual clarity.
Performance
Ensure FOV updates are efficient to avoid stuttering or frame drops.
Test responsiveness on various device configurations.
Edge Cases
Handle interruptions during gestures (e.g., a finger lifted mid-gesture).
Reset zoom level if required during app reloads or navigation.
Steps
[ ] Integrate ScaleGestureDetector into the OpenGL screen.
[ ] Create a utility method to map scale factor changes to FOV adjustments.
[ ] Update the OpenGL camera's FOV dynamically during gesture events.
[ ] Document the implementation for maintainability and future extensions.
Description
Add the ability to zoom in and out on the OpenGL screen using touch gestures. This will enhance user interaction by allowing users to explore the starmap more dynamically. The zoom effect will be achieved by modifying the camera's field of view (FOV) based on user input.
Objectives
Technical Considerations
Gesture Detection
ScaleGestureDetector
to track pinch gestures.FOV Modification
Performance
Edge Cases
Steps
ScaleGestureDetector
into the OpenGL screen.