Task 062: RT animation with panoramic camera

Your task is to implement animated panoramic camera (implemented in the task 022) and use it in an animation RT scenario. Ray-tracing scene geometry can be animated as well (for bonus points), 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 062animation-script project.

Camera animation - ideas

In the main repository branch, see the project 062animation-script (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. Or modify any suitable scene-definition scripts (perhaps the ones you used in the task 022). Add your animated 360°/180° camera together with all eventual new classes.
Devise some interesting animation scenario and implement it statically ("hard-wire") or implement some simple animation script format (include it in the same CSscript scene-definition file). Do not forget to present abilities of the panoramic camera.

What to hand in

You must send the modified file RayTracingAnim.cs. Declare the supposed time interval and FPS.
In addition to that you have to make panoramic video and upload it to some public video-server, YouTube or Vimeo, .. You must send the URL of the video.

If you will use CS-script for scene definition (see the project 062animation-script), attach the script 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).

Panoramic video - see YouTube instructions or general Google instructions.

Animations camera-animation examples


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


Basis: 20 points (panoramic camera animation, reasonable scene, producing and uploading panoramic video file),
up to 8 bonus points for animation of the scene (moving objects..),
more bonus points 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 project: 062animation-script or 062animation

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 2. 6. 2019.

Copyright (C) 2012-2019 J.Pelikán, last change: 2019-05-23 02:52:23 +0200 (Thu, 23 May 2019)