Download this file

70 lines (48 with data), 2.4 kB

// See following file for more information on the camera class template
// and options. 
// #include "<ANYBODY_PATH_MODELUTILS>/Video/VideoLookAtCamera.any"
#include "<ANYBODY_PATH_MODELUTILS>/Video/VideoLookAtCamera.any"


#define VIDEO_STUDY Main.Studies.InverseDynamicStudy
#define VIDEO_ANALYSIS InverseDynamics


VIDEO_STUDY = {
  VideoLookAtCamera VideoTool (UP_DIRECTION = y) = 
  {
     VideoName = Main.ModelSetup.TrialSpecificData.TrialFileName;
     
     // The resolution and aspect ratio of the video
     VideoResolution = {720, 1080}; 

     // Create frames in twice the video size and scale down when video
     // is created. This gives much better videos. Especially with lower resolutions
     VideoInputScale = 2; 

     // This fixes the "Look at point" at a specific height while still following the center of mass
     CameraLookAtPoint = 0.75*CameraUpDirection +
         mult(Main.HumanModel.BodyModel.Interface.CenterOfMass.Pos, not(CameraUpDirection));
     
     // The vertical field of view in meters at the LookAtPoint
     CameraFieldOfView = 1.9;
     
     // The direction which the camera is placed
     // (In global coordinates with respect to the LookAtPoint)
     CameraDirection = {1, 0.2, 1};
     
     // Counter used for nameing the indivual frames. 
     Counter = VIDEO_STUDY.iStep;
     
     
      // This will run the video in half speed.
     AnyVar VideoSpeed = 0.5;

     /// Determines the speed of the video. 
     /// Currently uses the VideoSpeed variable
     VideoInputFrameRate = round( VideoSpeed* VIDEO_STUDY.nStep/iffun(VIDEO_STUDY.tEnd-VIDEO_STUDY.tStart, VIDEO_STUDY.tEnd-VIDEO_STUDY.tStart, 1.0*VIDEO_STUDY.nStep)); 
   
    
     // Operation which run before recoding is started.
     PreAnalysis = {
         AnyOperation &step1 = Main.RunAnalysis.LoadParameters;
         AnyOperation &step2 = Main.RunAnalysis.MarkerTracking;
     };
     
     // The operations which should be included in the video.
     Analysis = {
         AnyOperation &ref = VIDEO_STUDY.VIDEO_ANALYSIS;
     };
     
     Create_Video.Settings.DisplayPriority = PriorityLow;
 };
};
 
 Main.ModelSetup = {
   AnyOperationSequence CreateVideo = {
     Settings.DisplayPriority = PriorityHigh;
     AnyOperation& CreateVideo = VIDEO_STUDY.VideoTool.Create_Video;
   };
 };