Skip to content
pr0gPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

The Original Arcball (by Ken Shoemake)

Overview

This repo is a slightly modified version of the original "Arcball Rotation Control" code by Ken Shoemake in "Graphics Gems IV", Academic Press, 1994.

The original code is hosted here by Eric Haines. It is also available from the resources section of Real Time Rendering website.

The arcball controller is detailed in chapter III.1 in Graphics Gems IV. The original paper on the topic by Ken Shoemake was published in 1992 and a copy can be obtained here.

The original demo uses a version of IRIS GL (the precursor to OpenGL). This demo has left as much of the original code intact as possible but is now using OpenGL 1.x calls in place of the IRIS GL calls and SDL for windowing. All files are very similar to the original apart from Demo.c which had to be largely rewritten to account for the different windowing API (SDL).

An attempt was made to use igl (an open source replacement for IRIS GL using OpenGL under X11) but there were other problems getting this to work so SDL was selected instead. The other advantage to this approach is the demo now works on Windows, macOS and Linux 🥳

Screenshot 2023-01-25 at 20 14 52 Screenshot 2023-01-25 at 20 19 32

Building

The demo uses CMake so ensure you have that installed as a prerequisite (as well as a working C compiler). SDL is downloaded as part of the build using FetchContent so you don't need that explicit dependency added before. The CMakeLists.txt file uses a find_package(OpenGL) call to find OpenGL. As the demo is using old-school OpenGL all tested OSes came pre-installed with this so no OpenGL loader is required.

Simply run the commands below from a terminal in the project root to configure and build.

# configure
cmake -B build # optionally include -G Ninja for faster builds
# build
cmake --build build
# run
./build/arcball # build\arcball.exe on Windows

Note: On Linux it may also be necessary to install a few additional dependencies, see them listed below:

> sudo apt-get install libx11-dev libglu1-mesa-dev libgl1-mesa-glx libxext-dev ninja-build

Thanks

Special thank you to Eric Haines and Andrew Glassner for allowing me to share this derivative work and their kind words of encouragement and support. Also a huge thank you to Ken Shoemake for this fantastic demo that is still magical to use 30 years later!

License

For the original license of Graphics Gem code please see here. This repo has uses a standard MIT license.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages