Click here to Skip to main content
11,921,889 members (68,215 online)
Click here to Skip to main content
Add your own
alternative version


94 bookmarked

ExoEngine - a C# 3D engine

, 27 Jul 2002 CPOL
Rate this:
Please Sign up or sign in to vote.
A basic 3D engine built using C# and the .NET platform


(click the thumbnails to expand)


For my fourth year computer graphics course I wrote a little 3D engine using C# and the .NET platform.  I decided to go this route as opposed to the C++ route that everyone else took in the course because I wanted to see whether C# lived up to it's hype.  Surprising, after writing about 600kB of code in C# it seems like it is a decent language after all and possibly an effective replacement for the C++ even in demanding field of real-time graphics.  When I compare C# to C++ I find it's best features are garbage collection, less convoluted syntax and true object orientation.

Just a quick disclaimer before I go too far -- please remember that I am only a student (and a cognitive science/neuroscience student at that) and not John Carmack thus don't get your expectations too high.

How the Engine Works

I must immediately give credit for the OpenGL/C# library that Lloyd Dupont created -- it is an amazingly easy library to use.  I have modified the library in the course of creating this project but not significantly.

This 3D engine imports it's level/worlds data from the popular Worldcraft editor .  Strangely, Worldcraft outputs it's world/level data in sets of bounding planes which define the contours of solid objects.  Thus one has to convert the bounding plane sets into their respective sets of polygons.  The resulting set of faces is then quickly optimized to remove hidden/redundancy faces created by adjacent objects.  Then this face set is converted into a binary space partition tree (commonly just called a "BSP tree") representation for both collision detection purposes and efficient visibility calculations.  There is also some auxiliary code that recognizes specifically defined entities in the Worldcraft data such as the animated pond and the various duck sprites -- but that is pretty simple.

This engine allows for polygons to be rendered using reflection mapping, (fake) Phong shading, Gouraud shading or just simple flat shading.  The engine uses reflection mapping to get the somewhat realistic look of the pond's waves.  The (fake) Phong shading is used on the ducks in order to make them look shiny and smoothly rounded -- the primary effect of Phong shading (usually called specular reflection) is the viewer/camera dependent white highlights.

The 600kB of code responsible for this engine is divided into three parts: "ExocortexNative", a C++ support library for OpenGL and TIFF images, "Exocortex", a C# library that I am using across projects, and "ExoEngine", the code that is specific to this application.  The "Exocortex" library actually contains some fairly reusable classes for 3D applications such as OpenGL compatible matrix, vector and quaternion classes as well as more specialized classes for Marching Cubes and multidimensional fast Fourier transforms.

Source Code

Full Source Code with VS.NET RC1 Project Files (2.3MB)

  • Will compile and run successfully on .NET v1.0.3328
  • Will compile and crash on .NET v1.0.2914


Currently distributing C# applications is a lot of trouble since the .NET platform is still in beta.  Hopefully the compatibility between different .NET versions will be better after it's release.

Option A: Full Installer (24.4MB)

  • choose this option if you haven't installed any .NET beta software.
  • includes the application (one exe and 2 dll's) and the .NET platform (build: v1.0.3328)
  • no source code included

Option B: Application Files Only (1.0MB)

  • choose this option if you currently have v1.0.3328 of the .NET platform installed
  • includes just the application files (one exe and 2 dll's)
  • no source code included

Option C: Sorry, no binaries for you.

  • if you have another version of .NET beside v1.0.3328 you can not download binaries from me that will work on you machine.
  • if may be possible to download and then compile the source code?


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ben Houston
Web Developer
Canada Canada
No Biography provided

You may also be interested in...

Comments and Discussions

Generalconcept Pin
zhima198814-May-10 3:31
memberzhima198814-May-10 3:31 
GeneralExo engine installer Pin
Anthony_Yio16-Apr-04 3:44
memberAnthony_Yio16-Apr-04 3:44 
GeneralRe: Exo engine installer Pin
Ben Houston16-Apr-04 6:22
memberBen Houston16-Apr-04 6:22 
Generalit rocks! Pin
chenhuisheng8-Apr-04 23:00
memberchenhuisheng8-Apr-04 23:00 
QuestionWhere are the marching cubes? Pin
Peter Schatz27-Feb-04 8:20
memberPeter Schatz27-Feb-04 8:20 
AnswerRe: Where are the marching cubes? Pin
Ben Houston16-Apr-04 6:22
memberBen Houston16-Apr-04 6:22 
GeneralC# game programming feasability Pin
Filip Strugar17-Oct-03 12:05
memberFilip Strugar17-Oct-03 12:05 
GeneralRe: C# game programming feasability Pin
Roman Godhill27-Dec-06 0:49
memberRoman Godhill27-Dec-06 0:49 
GeneralPerformance (or not) Pin
Brian Azzopardi29-Jul-02 0:25
memberBrian Azzopardi29-Jul-02 0:25 
GeneralRe: Performance (or not) Pin
Ben Houston29-Jul-02 8:15
memberBen Houston29-Jul-02 8:15 
QuestionWorking on ver 1.0 ? Pin
Trond Nilsen23-Jan-02 11:49
memberTrond Nilsen23-Jan-02 11:49 
AnswerRe: Working on ver 1.0 ? Pin
Ben Houston24-Mar-02 10:25
memberBen Houston24-Mar-02 10:25 
GeneralExoEngine Pin
Paul Selormey10-Jan-02 18:08
memberPaul Selormey10-Jan-02 18:08 
GeneralRe: ExoEngine Pin
Ben Houston10-Jan-02 19:02
memberBen Houston10-Jan-02 19:02 
GeneralImpressive!!!! Pin
Nish [BusterBoy]10-Jan-02 17:55
memberNish [BusterBoy]10-Jan-02 17:55 
General[Msg Deleted] Pin
Fazlul Kabir10-Jan-02 17:42
memberFazlul Kabir10-Jan-02 17:42 
GeneralRe: C# and Real Time Graphics Pin
Ben Houston10-Jan-02 19:06
memberBen Houston10-Jan-02 19:06 
GeneralRe: C# and Real Time Graphics Pin
Nish [BusterBoy]10-Jan-02 20:45
memberNish [BusterBoy]10-Jan-02 20:45 
GeneralRe: C# and Real Time Graphics Pin
CLaW10-Jan-02 21:55
memberCLaW10-Jan-02 21:55 
GeneralRe: C# and Real Time Graphics Pin
Nish [BusterBoy]10-Jan-02 22:08
memberNish [BusterBoy]10-Jan-02 22:08 
GeneralRe: C# and Real Time Graphics Pin
Brit9-May-02 10:38
memberBrit9-May-02 10:38 
GeneralRe: C# and Real Time Graphics Pin
Mr Morden10-Jul-02 18:23
memberMr Morden10-Jul-02 18:23 
GeneralRe: C# and Real Time Graphics Pin
Brit10-Jul-02 19:12
memberBrit10-Jul-02 19:12 
GeneralRe: C# and Real Time Graphics Pin
eltwo27-Jul-02 6:46
membereltwo27-Jul-02 6:46 
GeneralRe: C# and Real Time Graphics Pin
Anonymous27-Jan-03 11:50
sussAnonymous27-Jan-03 11:50 
GeneralRe: C# and Real Time Graphics Pin
AArnott19-Apr-04 2:17
memberAArnott19-Apr-04 2:17 
GeneralRe: C# and Real Time Graphics Pin
Filip Strugar17-Oct-03 12:25
memberFilip Strugar17-Oct-03 12:25 
GeneralRe: C# and Real Time Graphics Pin
Brit17-Oct-03 15:46
memberBrit17-Oct-03 15:46 
GeneralRe: C# and Real Time Graphics Pin
Filip Strugar18-Oct-03 1:28
memberFilip Strugar18-Oct-03 1:28 
GeneralRe: C# and Real Time Graphics Pin
Daniel Turini10-Jan-02 22:53
memberDaniel Turini10-Jan-02 22:53 
GeneralRe: C# and Real Time Graphics Pin
Nish [BusterBoy]10-Jan-02 23:10
memberNish [BusterBoy]10-Jan-02 23:10 
GeneralRe: C# and Real Time Graphics Pin
Brit9-May-02 10:27
memberBrit9-May-02 10:27 
GeneralRe: C# and Real Time Graphics Pin
Anonymous12-Apr-03 15:22
sussAnonymous12-Apr-03 15:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151120.1 | Last Updated 28 Jul 2002
Article Copyright 2002 by Ben Houston
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid