Afterwarp Development

Game development using Delphi and FreePascal compilers.

 

Who's Online

We have 4 guests online

Please Support Asphyre!

Texture Mapping PDF Print E-mail
Tuesday, 04 December 2007 05:22

Image This page contains an open-source Delphi project, which demonstrates several texture mapping algorithms, 3D rendering pipeline and PQ Torus Knot runtime generation. The project comes with compiled binary and full source code.

Although OpenGL and Direct3D both have hardware implementation of texture mapping, there are systems where such implementation is not available. The code can be converted to FreePascal/Lazarus with minimal effort and can be particularly useful on embedded systems like PocketPC with Windows CE.

The project uses several pieces from Asphyre Sphinx to simplify tasks such as image loading and software rendering canvas. All the required units were included in the package to make it self-contained.

  • The application generates a 3D mesh in run-time based on PQ Torus Knot explanation written on Jim Scott's blog.

  • The software 3D pipeline uses SIMD/SSE vector transformation routines originally published embedded in C/C++ by Cort Stratton in 2002. The code was adapted to work with Delphi.

  • The application contains Affine Texture Mapping code originally written in C/C++ and published in "fatmap2.zip" package by Mats Byggmastar in 1997. The code was ported to Delphi.

  • In addition, the application uses Perspective Texture Mapping code originally written in C/C++ by Chris Hecker and published in his articles. The code was ported to Delphi and is available with the kind permission of the author.

  • In order to render triangles properly on the screen, the application uses an implementation of Sutherland-Hodgman algorithm for clipping polygons with optional perspective correction.

Source + Binary download (04-Dec-2007):

TexMap2.zip - ZIP package (990 KiB)
TexMap2.7z - 7z package (800 KiB)

Last Updated on Monday, 19 September 2011 23:22