Skip to content

A simple 3D world rendered in ~200 lines of Swift code (no 3D/graphics libraries)

Notifications You must be signed in to change notification settings

matthewreagan/Simple3DSwift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple 3D Swift

Simple3DSwiftDemo

A quick experiment in minimalist Swift coding and 3D math.

The Goal

To create an interactive 3D wireframe world using minimal Swift code and no 3D or graphics libraries (AppKit is used for keyboard event handling and basic drawing).

Result

The 3D world is composed, rendered, and animated in about 200 lines of Swift (code here), which includes geometry, event handling, and animation.

Discussion

This code could be condensed further, and could certainly be improved in many ways (this is by no means a practical or robust 3D engine). Mostly this was an experiment to see if I could reduce the math for a basic 3D renderer down to the barest essentials.

Author

Matt Reagan - Website: http://sound-of-silence.com/ - Twitter: @hmblebee

License

Source code and related resources are Copyright (C) Matthew Reagan 2019. The source code is released under the MIT License.

About

A simple 3D world rendered in ~200 lines of Swift code (no 3D/graphics libraries)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages