Cutscenes Part 2: Splines and Camera Movement: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
Line 8: Line 8:
Download the file [snitch2.zip.txt], remove the ".txt" from the filename,  
Download the file [snitch2.zip.txt], remove the ".txt" from the filename,  
and extract it into your ''darkmod'' folder. This includes our ''Snitch'' set with all the cameras we created in Part 1.
and extract it into your ''darkmod'' folder. This includes our ''Snitch'' set with all the cameras we created in Part 1.
Open ''snitch2.map'' in Dark Radiant.


The first shot we want to create is to have the camera slowly rise from the porch to the south of the bulletin board while pointed in the direction of the bulletin board. To accomplish this, we'll need to add a ''func_splinemover'', which holds a spline (NURBS curve), a ''func_mover'', a ''func_cameraview'', a ''target_null'', and, of course, a script function to bring everything together.
The first shot we want to create is to have the camera slowly rise from the porch to the south of the bulletin board while pointed in the direction of the bulletin board. To accomplish this, we'll need to add a ''func_splinemover'', which holds a spline (NURBS curve), a ''func_mover'', a ''func_cameraview'', a ''target_null'', and, of course, a script function to bring everything together.


Since the next part is a bit tricky, we'll spell out each step.
===''func_splinemover''===
* Open ''snitch2.map'' in Dark Radiant.
Create a ''func_splinemover'' to hold our spline data.
 
* Create a 16x16x16 brush sitting on the porch south of the bulletin board (in front of the tall door).
* Create a 16x16x16 brush sitting on the porch south of the bulletin board (in front of the tall door).
* Texture it with NODRAW.
* Texture it with NODRAW.
* Select it and make it a func_splinemover ({{RMB}}, ''Create entity'', ''darkmod/func/func_splinemover''). This will hold a path for our camera to follow, so we need to define that path.
* Select it and make it a ''func_splinemover'' ({{RMB}}, ''Create entity'', ''darkmod/func/func_splinemover'').
* Change its name to "Splinemover5" ("name" "Splinemover5").
* Change its name to "Splinemover5" ("name" "Splinemover5").
Notice that Splinemover5 doesn't have any spline data in it. For that, we'll need to create a spline and copy its data to Splinemover5.
===NURBS spline===
Create a NURBS spline.
* With Splinemover5 selected, hit the ''Change views'' button (the XYZ button on the main menu) three times. This centers all views on Splinemover5.
* With Splinemover5 selected, hit the ''Change views'' button (the XYZ button on the main menu) three times. This centers all views on Splinemover5.
* From the main menu, select ''Curve->Create NURBS Curve''. This creates a spline (NURBS) curve with the same origin as Splinemover5.
* From the main menu, select ''Curve->Create NURBS Curve''. This creates a spline entity with the same origin as Splinemover5.


At this point, Splinemover5 and the spline curve should look like this:
At this point, Splinemover5 and the spline entity should look like this:
[[Image:Spline5.jpg|200px|thumb|left|Splinemover5 and its spline]]
[[Image:Spline5.jpg|200px|thumb|left|Splinemover5 and its spline]]
{{clear}}
{{clear}}
Line 26: Line 34:


* Select the spline anywhere along its curve.
* Select the spline anywhere along its curve.
* In the Entity window, select the Property ''curve_Nurbs''. This property will appear in the field below with the green checkmark on the right.
* In the Entity window, select the Property ''curve_Nurbs''. This property will appear on the line with the green checkmark on the right.
* Hit {{key|ESC}} and select Splinemover5.
* Hit {{key|ESC}} and select Splinemover5.
* Click on the green arrow. This transfers the spline curve to Splinemover5, which is where we want it.
* Click on the green arrow. This transfers the spline curve to Splinemover5, which is where we want it.
* Hide Splinemover5.
* Hide Splinemover5.
* Delete the spline.
* Delete the spline entity.
* Unhide Splinemover5.
* Unhide Splinemover5.


Line 49: Line 57:
==Camera Movement==
==Camera Movement==


===Create a func_mover===
===''func_mover''===
Splinemover5 provides the path our camera will follow, but we need a func_mover to provide the movement.
Splinemover5 provides the path our camera will follow, but we need a ''func_mover'' to provide the movement.


Create a 16x16x16 brush above Splinemover5 and texture it with NODRAW.
* Create a 16x16x16 brush above Splinemover5 and texture it with NODRAW.


Select it, make it a func_mover ({{RMB}}, ''Create entity'', ''darkmod/func/Movers/func_mover''), and give it these Property/Value pairs:
* Select it, make it a func_mover ({{RMB}}, ''Create entity'', ''darkmod/func/Movers/func_mover''), and give it these Property/Value pairs:


* "name" "Mover5"
# "name" "Mover5"
* "cinematic" "1"
$ "cinematic" "1"


We'll discuss the ''cinematic'' property below.
We'll discuss the ''cinematic'' property below.

Revision as of 17:12, 3 September 2010

NOTE: This article is under construction until this NOTE goes away.


Splines

Moving cameras can add a nice touch to a scene if not overused. Splines provide a path a camera can follow.

Download the file [snitch2.zip.txt], remove the ".txt" from the filename, and extract it into your darkmod folder. This includes our Snitch set with all the cameras we created in Part 1.

Open snitch2.map in Dark Radiant.

The first shot we want to create is to have the camera slowly rise from the porch to the south of the bulletin board while pointed in the direction of the bulletin board. To accomplish this, we'll need to add a func_splinemover, which holds a spline (NURBS curve), a func_mover, a func_cameraview, a target_null, and, of course, a script function to bring everything together.

func_splinemover

Create a func_splinemover to hold our spline data.

  • Create a 16x16x16 brush sitting on the porch south of the bulletin board (in front of the tall door).
  • Texture it with NODRAW.
  • Select it and make it a func_splinemover (Click the right mouse button, Create entity, darkmod/func/func_splinemover).
  • Change its name to "Splinemover5" ("name" "Splinemover5").

Notice that Splinemover5 doesn't have any spline data in it. For that, we'll need to create a spline and copy its data to Splinemover5.

NURBS spline

Create a NURBS spline.

  • With Splinemover5 selected, hit the Change views button (the XYZ button on the main menu) three times. This centers all views on Splinemover5.
  • From the main menu, select Curve->Create NURBS Curve. This creates a spline entity with the same origin as Splinemover5.

At this point, Splinemover5 and the spline entity should look like this:

Splinemover5 and its spline

Now we have to move the spline's curve data into Splinemover5.

  • Select the spline anywhere along its curve.
  • In the Entity window, select the Property curve_Nurbs. This property will appear on the line with the green checkmark on the right.
  • Hit ESC and select Splinemover5.
  • Click on the green arrow. This transfers the spline curve to Splinemover5, which is where we want it.
  • Hide Splinemover5.
  • Delete the spline entity.
  • Unhide Splinemover5.

At this point, Splinemover5 looks like the previous picture, only now it's holding the spline data.

Movement along this spline will begin at its origin and follow its path. At the moment, the path curves away from the origin in the XY plane. Since we want the camera to rise straight up, we need to change the spline path so it goes straight up from the spline's origin.

  • With Splinemover5 selected, press V to enter Vector mode. Two green dots will appear along the path. These are control points, and we're going to adjust them.
  • In the YZ view, drag the leftmost control point so it's 16 units directly above the spline's origin. You might need to set the grid size to 1 to do this. Note how the dashed line of the path changes when you do this.
  • Drag the rightmost control point so it's 48 units above the spline's origin.

In the camera view, the spline's path has changed, but it's still a curve, so we have to make two more adjustments.

  • In the XY view, drag both control points so they're directly over the origin, and the spline path is finished.
Splinemover5 Halfway There
Splinemover5 Finished

Camera Movement

func_mover

Splinemover5 provides the path our camera will follow, but we need a func_mover to provide the movement.

  • Create a 16x16x16 brush above Splinemover5 and texture it with NODRAW.
  • Select it, make it a func_mover (Click the right mouse button, Create entity, darkmod/func/Movers/func_mover), and give it these Property/Value pairs:
  1. "name" "Mover5"

$ "cinematic" "1"

We'll discuss the cinematic property below.

Create Camera5

Splinemover5, Mover5, and Camera5

Create a func_cameraview above Mover5 and give it these Property/Value pairs:

  • "name" "Camera5"
  • "trigger" "1"
  • "bind" "Mover5"

The bind property allows Camera5 to follow Mover5 as Mover5 follows the spline.