EAGL.Examples.LearnOpenGL.GettingStarted.CameraCircle (eagl v0.8.0)

View Source

LearnOpenGL 7.1 - Camera (Circle)

This example introduces the camera system in OpenGL by demonstrating how the view matrix controls the camera position and orientation. It shows a simple circular camera movement around multiple textured cubes to illustrate basic camera concepts.

Original C++ Source

This example is based on the original LearnOpenGL C++ tutorial: https://github.com/JoeyDeVries/LearnOpenGL/tree/master/src/1.getting_started/7.1.camera_circle

Framework Adaptation Notes

This example introduces fundamental camera concepts:

  • The camera as a virtual viewpoint in 3D space
  • View matrix calculation using camera position and orientation
  • Circular camera movement using trigonometric functions
  • How camera movement affects the perspective of the scene

Key Learning Points

  • Camera Coordinate System: Understanding camera position, target, and up vector
  • View Matrix: How the view matrix transforms world coordinates to camera space
  • Camera Movement: Moving the camera position while keeping the target fixed
  • Smooth Animation: Using time-based trigonometric functions for circular motion

Camera Concepts Introduced

  • Camera Position: Where the camera is located in world space
  • Camera Target: What point the camera is looking at
  • Camera Up Vector: Which direction is "up" for the camera
  • Look-At Matrix: Mathematical transformation from camera parameters to view matrix

Visual Effect

Shows multiple textured cubes with a camera orbiting around them:

  • Camera moves in a circular path around the scene
  • Camera always points toward the center of the scene
  • Demonstrates how camera position affects the view of objects
  • Smooth, continuous circular motion
  • 10 cubes at different positions with individual rotations

Usage

EAGL.Examples.LearnOpenGL.GettingStarted.CameraCircle.run_example()

Press ENTER to exit.

Summary

Functions

run_example(opts \\ [])