9.34 Rotate
On this page:
9.34.1 Examples
9.34.1.1 Rotation by 45 degrees along z-axis
9.34.1.2 An animated rotation along the y-axis

9.34 Rotate

Rotates the scene by a given angle about a given axis.

 

Parameters

 

Default

 

Range    

 

Description

 

degrees

 

0.0

 

n/a

 

Amount of rotation in degrees.

 

 

 

 

 

ex

 

0.0

 

{-1,1}

 

ex, ey and ez specify the orientation of the axis about which to rotate the scene.

 

 

 

 

 

ey

 

0.0

 

{-1,1}

 

 

 

 

 

 

ez

 

0.0

 

{-1,1}

 

Input pattern: (A)

9.34.1 Examples
9.34.1.1 Rotation by 45 degrees along z-axis
; muSE v2
 
(style-parameters)
 
(segment-durations 8.0)
 
(define muvee-global-effect (effect-stack
                                (effect "Perspective" (A))
                                (effect "CropMedia" (A))))
 
 
 
(define rotate45
        (effect "Rotate" (A)
                (param "degrees" 45.0)
                (param "ez" 1.0)))
 
 
(define muvee-segment-effect rotate45)

We are interested in only the last two code chunks. We first define a variable named rotate45. rotate45 will contain the Rotate effect and assign two of its parameters. The amount of degrees to rotate by is set at 45. By setting the ez to 1.0, we indicate that we wish to rotate about the z-axis.

After we’ve done that, all we need to do is to assign the rotate45 to muvee-segment-effect. Et voila!

9.34.1.2 An animated rotation along the y-axis
; muSE v2
 
(style-parameters)
 
(segment-durations 8.0)
 
(define muvee-global-effect (effect-stack
                                (effect "Perspective" (A))
                                (effect "CropMedia" (A))
                                (effect "Translate" (A)
                                        (param "z" -1.0))))
 
 
 
(define animate-rotate-45
        (effect "Rotate" (A)
                (param "degrees" 0.0 (linear 1.0 45.0))
                (param "ey" 1.0)))
 
 
(define muvee-segment-effect animate-rotate-45)

A few things to note here.
  • At the global level, I translated all the user media by -1.0 in the z-axis. It’s purely for aesthetic reasons as I want the rotation to be seen properly.

  • I am now rotating along the y-axis and therefore ey has been set to 1.0

  • The degrees parameter is being animated. At the start of each segment, the value of degrees is zero. At the end of the segment i.e. at time = 1.0 ( segment durations are normalized, meaning they start at t = 0.0 and end at t = 1.0 ) the value of degrees is 45.0. So what we end up having is a smooth rotation throughout each segment. Refer to Explicit animation curves for more info.

If you find the explanation confusing, simply try the style out. You will quickly understand what the code is doing.