flipCode - Tech File - Jeroen Bouwens [an error occurred while processing this directive]
Jeroen Bouwens
Click the name for some bio info

E-Mail: flipcode@jeroen.ws



   04/29/1999, Introduction


Hi There,

Well, this is my personal flipCode tech-file. Since thereís no fixed format/content for these files, I decided to make this a kind of progress-report page for my 3D-engine, Manic Motion. Currently, this engine is in its early stages of development. The main features so far are:
  • Flat and Gouraud shading.
  • Embedded platonic solids (Tetrahedron, cube, octahedron, dodecahedron, isocahedron).
  • Dynamic lighting.
  • The test-application I use for development is available for download here, and I will update it when I think itís interesting. Iím working on the engine on and off, so expect no regular updates. I maintain this tech-file for myself, so if you think itís interesting thatís a nice bonus.

    The design of the engine is not pre-determined. Iím actually thinking up algorithms as I code, so I expect that on the long run I will completely restart with a new engine. Talking about algorithms, Manic Motion is based on homogeneous coordinates. This is very interesting for a number of reasons, most notably clipping. Coordinates are transformed through a number of different linear spaces before the actual drawing. Every space (or "reference frame") has its own use:
  • Definition space/Local space/Object space: In this space, the objects are defined. The origin is usually in the approximate centre of the object. Coordinates in this space serve as the basis for the rendering and will normally remain constant (Except for animating objects).

  • World-space: This is the "Meta-space" in which everything takes place. Lights, Cameras and Objects are placed in world-space, relative to its origin. Lighting/Shading takes place in this space.

  • Camera-space: This is the space with the camera at the origin, and the z-axis along the top-axis of the view-frustum. This is still a normal 3D-space, except that all coordinates are now relative to the camera. Here, backface-culling is performed.

  • Perspective-space: This is where homogeneous coordinates come into play. Normally, using 4x4 matrices, a coordinate would be represented by [X,Y,Z,1]. In this space however, this becomes [X,Y,Z,W], where W is not necessarily 1. Yes, a real 4D-representation. The transformation to perspective space contains information about the view-frustum (FOV and near/far clipping planes). In this space, the view-frustim is not a pyramid anymore, but a simple rectangular bar. This means that instead of testing against a 3D-plane, a point is outside the frustum if a coordinate is >W or <-W. So testing against the left clipping plane means testing all X-values against the -W-value of the same point. Transformation to screen space simply means dividing X and Y by W.

  • Screen-space: Well, this speaks for itself. This is the screen. This is where the work ends and where the polygons that are so carefully selected by everything before are actually drawn. On a side note: This space is not linear anymore.
  • Of course, I glossed over a lot of (optimization) details here. After all, this is not a tutorial, just a tech-file :). In the near future, I want to perfect the 3D-clipping in perspective space, and implement a c-buffer derived rasterizer. Iím also still tinkering with the class-definitions, and I want to include a timer-function to see which part of the rendering-pipeline is best at using up precious CPU-time. Expect these things soon.

    Well, all that remains for now is the download link. Here it is: ManicMotion.exe (~450k)





  • 04/01/2002 - Thoughts On Software Development
  • 09/10/2000 - Observe Your Objects
  • 01/31/2000 - Factories
  • 09/14/1999 - Polymorphism and Inheritance
  • 08/14/1999 - Object Design
  • 06/04/1999 - OpenGL Mania
  • 05/04/1999 - 3D Clipping
  • 04/29/1999 - Introduction

  • This document may not be reproduced in any way without explicit permission from the author and flipCode. All Rights Reserved. Best viewed at a high resolution. The views expressed in this document are the views of the author and NOT neccesarily of anyone else associated with flipCode.

    Download The Sample Program: ManicMotion.exe

    [an error occurred while processing this directive]