Home      |      Products      |      Services      |      About      |      Portfolio

Download this demo
Name: MelonDemo.zip
Size: 1.2 MB
Download the Source Code
Name: QuatDemo.zip
Size: 21.2 KB

3D Quaternion Rotation Example

Below demonstrates my understanding of quaternion mathematics (hyper-complex numbers based on euler angles). There are absolutely no graphics or animations in this demonstration, and it is 100% my own original work. This version is written in Java for applet convienience.

  • Faces and glyphs of the cube are based on the fillPoly method
  • 3D vectors converted to 2D graphics methods using the following formulas:
    X2d = Z3d + X3d / (Z3d - C * (F + C))Y2d = Z3d + Y3d / (Z3d - C * (F + C))
  • Quaternion rotation transform is v(w^2 - x^2 - y^2 - z^2) + 2e(e . v) + 2(v >< e)w, vector e = < x, y, z >

The source code can be further optimized because for every vector operation heap space is allocated, and transforms are calculated upon every call to paint, which can be cached.

DirectX Example

Experimented with 3D graphics development using the DirectX development kit. One such example is wrapping a bitmap around a flexing sphere with lighting:
Home  |  Contact  |  About  |  Services  |  Products  |  Clientele  |  Portfolio  |