This tutorial explores cameras in TouchDesigner, which serve as our window into the render network. Understanding how to position and animate cameras is essential for creating dynamic 3D scenes.
Setting Up a Basic Render Network
Before working with cameras, you need a basic render setup:
- Open the OP Create dialog with the Tab key
- Hold Ctrl and add a Camera, Geometry, and Light component
- From the TOP family, add a Render TOP
Tip: Split your view and open the Geometry Viewer on one side to see your scene from a different vantage point while working.
Positioning Cameras with Path SOPs
Manually positioning cameras can be frustrating. TouchDesigner offers a powerful alternative: using Surface Operators (SOPs) to define camera paths.
Creating a Camera Path
Step 1: Add a Circle SOP
- Open the OP Create dialog
- Add a Circle SOP from the Surface Operator family
Step 2: Set Up the Path
- Add a Null SOP after the Circle (Alt+N shortcut)
- Enable the Template flag (the magenta/purple flag) on the Null to visualize it in the Geometry Viewer
- Change the Circle’s orientation to ZX to position it horizontally
Step 3: Connect to Camera
- On the Camera component, set translation to zero (positioning it at origin)
- Drag the Null SOP onto the Camera’s “Path SOP” parameter
Step 4: Adjust Path Size
- Right-click on the wire between Circle and Null
- Insert a Transform SOP
- Use the Universal Scale parameter to resize the path
Animating Along the Path
Once connected, the Camera component gains a Position slider that lets you animate the camera along the defined path. This provides smooth, controlled camera movement without manual keyframing.
Look At Functionality
A common challenge is keeping the camera focused on your subject while it moves. TouchDesigner solves this with the Look At feature.
Setting Up Look At
- Add a Null Component (not a Null SOP) to your network
- This acts as an empty piece of geometry with spatial properties but no rendered output
- Drag the Null Component onto the Camera’s “Look At” parameter
Result: As the camera animates along its path, it continuously points toward the Null Component. This eliminates the need to manually adjust camera rotation every frame.
Benefits of Look At
- Control camera focus independently from camera position
- Easily change what the camera looks at by moving the Null Component
- Works with Geometry and Light components too, enabling complex scene setups
Camera Projection Types
Cameras offer different projection modes accessible from the View page:
Perspective Projection
The default mode that mimics how human eyes see the world, with objects appearing smaller as they get farther away.
Orthographic Projection
Objects maintain their size regardless of distance from the camera. Useful for:
- Technical visualizations
- 2D-style graphics in 3D space
- Architectural views
Perspective-Ortho Blend
A unique feature that lets you smoothly transition between perspective and orthographic views:
- Adjust the blend parameter to mix between projection types
- Control the Projection Width for orthographic sizing (try values around 2 for tighter framing)
Key Takeaways
- Path-based animation: Use SOPs like Circle and Transform to create camera paths instead of manual positioning
- Template flag: Enable this on SOPs to visualize paths in the Geometry Viewer
- Null Components: Use these as look-at targets for smooth camera tracking
- Look At parameter: Available on Camera, Geometry, and Light components for consistent behavior
- Projection types: Choose between Perspective, Orthographic, or blend between them for different visual effects
- Position slider: Animate cameras along paths using this parameter on the Camera component
本教程探索TouchDesigner中的相机,它是我们进入渲染网络的窗口。理解如何定位和动画相机对于创建动态3D场景至关重要。
设置基础渲染网络
在使用相机之前,你需要一个基础渲染设置:
- 使用Tab键打开OP创建对话框
- 按住Ctrl添加相机、几何体和灯光组件
- 从TOP家族中添加渲染TOP
提示: 分割视图并在一侧打开几何体查看器,以便在工作时从不同角度查看场景。
使用路径SOP定位相机
手动定位相机可能很繁琐。TouchDesigner提供了一个强大的替代方案:使用表面操作符(SOP)来定义相机路径。
创建相机路径
步骤1:添加Circle SOP
- 打开OP创建对话框
- 从表面操作符家族添加Circle SOP
步骤2:设置路径
- 在Circle后添加Null SOP(Alt+N快捷键)
- 在Null上启用模板标志(洋红色/紫色标志)以在几何体查看器中可视化
- 将Circle的方向改为ZX使其水平放置
步骤3:连接到相机
- 在相机组件上,将平移设置为零(定位在原点)
- 将Null SOP拖到相机的”路径SOP”参数上
步骤4:调整路径大小
- 右键点击Circle和Null之间的连线
- 插入Transform SOP
- 使用统一缩放参数调整路径大小
沿路径动画
连接后,相机组件获得一个位置滑块,让你可以沿定义的路径动画相机。这提供了平滑、可控的相机移动,无需手动关键帧。
注视功能(Look At)
一个常见的挑战是在相机移动时保持对准目标。TouchDesigner通过注视功能解决了这个问题。
设置注视
- 在网络中添加Null组件(不是Null SOP)
- 它作为一个具有空间属性但不渲染输出的空几何体
- 将Null组件拖到相机的”注视”参数上
结果: 当相机沿路径动画时,它会持续指向Null组件。这消除了每帧手动调整相机旋转的需要。
注视功能的优势
- 独立于相机位置控制相机焦点
- 通过移动Null组件轻松改变相机注视目标
- 也适用于几何体和灯光组件,实现复杂场景设置
相机投影类型
相机提供不同的投影模式,可从视图页面访问:
透视投影(Perspective)
默认模式,模拟人眼看世界的方式,物体越远看起来越小。
正交投影(Orthographic)
无论距离相机多远,物体都保持相同大小。适用于:
- 技术可视化
- 3D空间中的2D风格图形
- 建筑视图
透视-正交混合
一个独特的功能,让你可以在透视和正交视图之间平滑过渡:
- 调整混合参数在投影类型之间混合
- 控制投影宽度进行正交尺寸调整(尝试约2的值以获得更紧凑的构图)
关键要点
- 基于路径的动画:使用Circle和Transform等SOP创建相机路径,而不是手动定位
- 模板标志:在SOP上启用此标志以在几何体查看器中可视化路径
- Null组件:使用这些作为注视目标实现平滑的相机跟踪
- 注视参数:在相机、几何体和灯光组件上都可用,行为一致
- 投影类型:在透视、正交之间选择,或混合它们以获得不同的视觉效果
- 位置滑块:使用相机组件上的此参数沿路径动画相机