21. September 2023

Data Types in Scene Nodes – 2 Vectors

The single most useful, and likely most used, datatype in Scene Nodes is Vector.

It comes in several different variations, the most commonly used of them is a the 3D Vector, which consists of 3 float values, usually referred to as X,Y and Z values. For color vectors it is RGB.
In case of 4D Vectors the fourth component is named W, or in case of ColorA the fourth component is A for Alpha.

In Scene Nodes, and most of Cinema 4D, they are used to hold values for Positions, Velocities and Directions, but also for Colors.

Depending on the problem to be solved a bit of vector mathematics is needed, i will not try to explain the math thoroughly, because there are betters sources for this on the internet, but i will try to convey the basic use.

For geometry vectors are mainly used in three way

  • Points – The positional information on where points are in space
  • Normals – Directional information mainly used for shading during rendering
  • Tangents – Directional information with a magnitude, used i.e. to define Bezier Splines

With particles or dynamics another common use is velocity, the direction and magnitude of movement.

A normal is a specific case of a vector with the length of 1. Normals play an important role when it comes to Matrices and how we define the alignment of objects in space.

It is important to note that under normal circumstances the three components of a vector X, Y and Z each represent a distance or position on one axis, where the three axis are all perpendicular to each other.

The default axis in the Cinema 4D viewport represents this with X – Red, Y – Green and Z – Blue

For your convenience the Node editor offers access to the components of vectors by unfolding the port

The color coding used for vector and float ports can be seen here as well.

Resources on Vectors

While there is always Wikipedia i would recommend going to more education oriented sites.

Mathinsight – Vector Introduction

Math is Fun – Cross Product

Khan Academy – Dot Product