Task 062: RT scene animation

Your task is to implement an animated RT scene (perhaps using your animated camera from the task 022), to define some new scene class[es] and an animation scenario. Ray-tracing scene geometry must be animated (in addition to the camera), e.g. translation / rotation movements of some objects, texture animation, free falls / throws, bouncing objects..
Ideal solition would be to extend our scene-scripting concept by a simple animation script format. Animation scripts could be stored in external text files, see the (future) 062animation-script project.

Camera animation - ideas

In the task 046 there already was an animated camera, it was included into the main repository branch, see the project 062animation. You can be inspired from it or even start your solution from the class AnimatedCamera : StaticCamera, ITimeDependent. Key animation properties are defined in the interface ITimeDependent (general dependency of any object on the time). In case of animation, you have to encapsulate the whole scene data into builtion class AnimatedScene : AnimatedRayScene, which will take care of all the time settings (propagation of the double Time changes).

Interface ITimeDependent

Current time (in seconds, type double) is set using this interface. Any reasonable object in ray-tracing data set can implement this interface, thereby it announces dependency on time (i.e. "it can be animated"). Attention: because frame rendering is usually parallelized in multiple threads, you have to abide the re-entrancy rules of your code. Especially animated object instances must not be shared, therefore the time-dependent objects (interface ITimeDependent) must be able to clone itself (interface IClonable - see the AnimatedRayScene.Clone() function). The idea is to separate all the parts which are actually dependent on time, static parts of a scene need not be cloned.


Animated scene node (which is able to translate/rotate itself) has to use proper interpolating curves (with C2 continuity for the best). For a scripted (i.e. not based on physical simulation) animation I recommend Hermite interpolation curves (e.g. Catmull-Rom splines or TCB splines), for interpolated orientation quaternions are the best (for both see the hw-08-math.en.pdf presentation).
Implementaion: some of the mentioned curves are already implemented in C language in the ogl repository, as well as quaternions. There are usable quaternions in the OpenTK library, too.

What to change

Modify the class RayScene scene-definition class in the RayTracingAnim.cs source file. Add your animated camera together with all eventual new classes into the same source file.
Devise some interesting animation scenario and implement it statically ("hard-wire") or implement some simple animation script format. Scripting would be best included in our CSscript scene-definition system

What to hand in

You must send the modified file RayTracingAnim.cs (if any new classes were defined). Declare the supposed time interval and FPS.
In addition to that you have to make a video file and upload it to some public video-server, YouTube or Vimeo, .. You must send the URL of the video (the video itself needs not be publicly listed but I have to be able to access it).

If you want to use CS-scriptu for scene definition (see the project 062animation-script), attach the script file as the second file. Script format: see builtin scene files from the directory data/rtscenes/ (especially the data/rtscenes/AnimatedScene.cs file - this is the animated version of the original static scene Two spheres and shows animation-related stuff together with reading an additional parameter /index of refraction/ from the text field params).

Production of the video file

Instruction page for video encoding. Windows executable of ffmpeg can be downloaded from this page. Sample batch file for AVI video encoding from sequence of disk images is in the repository (encode.bat).

Animations camera-animation examples


Hand in the assignment until: 20. 5. 2018. Some of the best results will be screened at the last lecture.


Basis: 22 points (reasonable scene animation, optional camera animation, produced and uploaded video file),
bonus for invention, soundtrack, etc.
competition: all solutions will be displayed on a web page after the deadline. There will be short public voting period, winners will receive additional bonus points.


Visual Studio projects: 062animation or 062animation-script

Source file

Modify and hand in the source file: RayTracingAnim.cs
Edit your name in the InitializeParams() function!


Vote on the result page, deadline is 3. 6. 2018.

Copyright (C) 2012-2018 J.Pelikán, last change: 2018-05-22 13:56:56 +0200 (Tue, 22 May 2018)