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

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
Line 9: Line 9:
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.


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 spline (NURBS curve), a ''func_mover'', a ''func_cameraview'', a ''target_null'', and, of course, a script function.
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.


In Dark Radiant, open ''snitch2.map''. In the XY view, shift the view so the porch south of the bulletin board (in front of the tall door) is near the center of the view. From the main menu, select ''Curve->Create NURBS Curve''. This creates a spline curve with its origin over the porch.
Since the next part is a bit tricky, we'll spell out each step.
* Open ''snitch2.map'' in Dark Radiant.
* Create a 16x16x16 brush sitting on the porch south of the bulletin board (in front of the tall door).
* Texture it with NODRAW.
* With this brush selected, right-click, choose ''Create entity'', and select ''darkmod/func/func_splinemover''. This entity will hold the path our camera will follow, but we need to define that path.
* Change this entity's name to "Splinemover5" ("name" "Splinemover5").
* With Splinemover5 selected, click on 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.


In the ZX view, drag the origin of the spline so it's a few units above the NODRAW brush covering the porch, and give this spline the following key/value pair:
At this point, Splinemover5 and the spline curve should look like this:
[[Image:Spline5.jpg|200px|thumb|left|Splinemover5 and its spline]]
{{clear}}
Now we have to move the spline's curve data into Splinemover5.
 
* Select the spline by clicking anywhere along its curve.
* In the Entity window, click on the Property curve_Nurbs. This property will appear in the field below 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 ("H" key).
* Delete the spline.
* Unhide Splinemover5 ("Shift H").
 
At this point, Splinemover5 looks like the previous picture, only now it's holding the spline data. 


* "name" "Spline5"
[[Image:Spline1.jpg|200px|thumb|left|Spline5 in XY View]] [[Image:Spline1a.jpg|200px|thumb|center|Spline5 in Camera View]]
{{clear}}
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.
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 Spline5 selected, press the "V" key 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.
* With Splinemover5 selected, press the "V" key 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.
Now drag the rightmost control point so it's 48 units above the spline's origin.
* 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 camera view, the spline's path has changed, but it's still a curve, so we have to make two more adjustments.


Switch to the XY view, drag both control points so they're directly over the origin, and the spline path is finished.
* In the XY view, drag both control points so they're directly over the origin, and the spline path is finished.
[[Image:Spline5b.jpg|200px|thumb|left|Spline5 Halfway There]][[Image:Spline5c.jpg|200px|thumb|center|Spline5 Finished]]
[[Image:Spline5b.jpg|200px|thumb|left|Splinemover5 Halfway There]][[Image:Spline5c.jpg|200px|thumb|center|Splinemover5 Finished]]


==Camera Movement==
==Camera Movement==


{{Template: Cutscenes}}
{{Template: Cutscenes}}

Revision as of 02:21, 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.

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.

  • Open snitch2.map in Dark Radiant.
  • Create a 16x16x16 brush sitting on the porch south of the bulletin board (in front of the tall door).
  • Texture it with NODRAW.
  • With this brush selected, right-click, choose Create entity, and select darkmod/func/func_splinemover. This entity will hold the path our camera will follow, but we need to define that path.
  • Change this entity's name to "Splinemover5" ("name" "Splinemover5").
  • With Splinemover5 selected, click on 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.

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

Splinemover5 and its spline

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

  • Select the spline by clicking anywhere along its curve.
  • In the Entity window, click on the Property curve_Nurbs. This property will appear in the field below 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 ("H" key).
  • Delete the spline.
  • Unhide Splinemover5 ("Shift H").

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 the "V" key 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