EAGL.Examples.LearnOpenGL.GettingStarted.CameraCircle (eagl v0.7.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 a single textured cube 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 a single textured cube with a camera orbiting around it:

  • Camera moves in a circular path around the cube
  • Camera always points toward the cube (fixed target)
  • Demonstrates how camera position affects the view of objects
  • Smooth, continuous circular motion

Usage

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

Press ENTER to exit.

Summary

Functions

run_example(opts \\ [])