I wonder how I can make a math curve/path representing an equation along another curve and make a camera follow it?
Make sure you have enabled Add Mesh: Extra Objects addon.
Add Mesh > Math Function > Z Math Surface.
Set up math function:
- Z Equation:
- X Subdivision: higher will give you better resolution
- Y Subdivision: set it to the lowest (3)
- X Size: this is your wave length
- Y Size: wave width
- Z Equation:
Go to Edit Mode and delete left and right edge from the mesh.
- In Object Mode hit Alt+C and Curve from Mesh/Text.
You can change Z height by scaling wave in Z axis or finding more suitable equation.
As for the second question you can find several answers here.
Curve on Curve.
- Make sure both objects has set Origin to Center of the Mass.
- Set cursor to selected 'road' object: Shift+S > Cursor to Selected.
- Move Sine Wave to Cursor: Shift+S > Selection to Cursor.
- Add Curve Modifier to Sine Wave, select 'road' path and choose -Y (could be different based on object rotation).
- Move Sine Wave along Y Axis to position it as you need.
You have really low units scale in this scene, and thus Math Function can't create big wave (I didn't knew about such limitations). So you need to create Sine wave with maxed X Size and Subdivision and after that Scale object up, or just change scene scale.
Blend file 1:
To properly use Sine Wave with Array Modifier you will need to pay attention while creating the wave to have beginning and end as close to X axis grid line as possible. Remember to check Merge option under Array Modifier and set it to the moment when vertices will join.
And for the Camera Follow Path, you can just use Curve and Array modifiers on unconverted mesh (right after creating and cleaning edges from Z Math), then apply modifiers and after that do step 5. from original answer.