Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Nov 2002
Offline Last Active Sep 05 2014 01:30 AM

Topics I've Started

How to automate testing for 3D-algorithms

04 April 2013 - 08:08 AM



to ensure that some graphic-algorithm just works even if I do some refactoring in an existing "historical grown" code base I want to do some automatic integration-tests for these ( like for instance using an animation-path ). Screen-resolution and used HW are constant. 

The approach I am currently thinking about is even straight forward:

  1. Start rendering the object to animate using the path at time 0 -> make the first screenshot
  2. At a given time during the animation -> make another screenshot
  3. At the end of the animation make the last screenshot
  4. Now do a bitmap compare between the reference pictures and the new one 
  5. Differences -> buggy algoriuthm


  • Easy to implement
  • You can validate some kind of visual representation


  • A lot of data will be generate
  • What happens when the difference is really small?
  • Animation is not checks, only some states of the animation itself.
  • You have to save the bitmaps
  • What to do with antialiasing

A different approach could be: 

  1. Start the anmation, save the transformation.
  2. Do this at a given point of time
  3. Do this at the end of the animation
  4. Look out for differences


  • Only numerical data
  • Easiy to check


  • How to deal with numerical rounding issues.
  • ...

So I am just curious: how do you deal with issues like this. Just be aware: I am not talking about pure unit-testings, I want to test the integration and the visual representation of a couple of classes and subsystems.


Thanks in advance,