The Cross product: Examples (3/3) - creating custom velocity field using cross product vectors.

Описание к видео The Cross product: Examples (3/3) - creating custom velocity field using cross product vectors.

PART 1: Understanding how the cross product works.
   • The Cross product: Theory (1/3)  

PART 2: Examples of how the cross product can help you better orient objects.
   • The Cross product: Examples (2/3) - o...  

PART 3: Example of how the cross product can create custom directions for forces. (this video)

Add me on Instagram: pclaesvfx

Hipfile: http://bit.ly/cross_product_hipfile

Related: Dot product video & radians/degrees explanation
   • Understanding the DOT product!  

OVERVIEW:
We will start with defining the cross-section of a pointcloud. Then we will build the backbone template points and copy the crossection on the template points to create a 3d pointcloud. Next we rasterize the direction vectors of the pointcloud into a vdb volume which we can use to advect particles inside a dop simulation.

FIRST: Initial geometry and normals.
We create a circle in the XY plane and scatter a bunch of points on it. We need normals on the points, so we compute point normals on the circle first and then the scattered points will inherit those surface normals.

SECOND: Defining the outwards pointing vectors.
In an attribute vop we can normalize the position of the points and output it into the N attribute. Over the viewport we can bring up the 'Display Options' (using the "d" shortcut) and adjust the viewport Scale of the normals to 0.1 so we can see the result better.

THIRD: Creating the backbone template points.
We create a 4 points and turn them into a polygonal line segment with an 'add' sop. Next we convert the polygon line segment to a smooth nurbs curve. A resample sop then allows us to specify the amount of template points that are needed. Then a polyframe is used to compute both the tangent normals along the curve as well as the bitangent which will be stored in the 'up' vector attribute.

FOURTH: Adjusting the up vector scale in the viewport.
Over the viewport we can bring up the Display Options again and also set the Scale of the vectors down to 0.1 so we can see the result better.

FIFTH: Getting rid of the line, keeping the points.
We adjust the resample sop to have slightly less points and use an add sop to delete the geometry but keep the points. Each of the points has a 'N' and 'up' vector which define the local coordinate system of the points which we need to copy the cross-sections onto the template points.

SIXTH: Create the pointcloud and rasterize into a volume.
We copy the cross-section onto the template points and can visualize the pointcloud with the normals. Next we use the 'volume rasterize attributes' to rasterize the direction vector into a volume. We will use the 'v' vector attribute to rasterize even though the 'v' attribute does not exist yet.

SEVENTH: Creating rotational vectors with the cross product.
Inside the attribute vop on the cross-section scatter points, we compute the cross product between the surface normal and the normals that are pointing away from the center. After normalizing the cross vector we plug it into the outgoing N and can see the rotational direction in the viewport.

EIGHT: Blending forces based on the radial distance - Containment force
- We have a unit length circle, so we can use the length of the points position and plug that into a ramp. After negating the vector that points outwards, it will now point inwards. We multiply the inwards vector with the containment ramp to weigh the containment direction force. Next we modify the containment ramp to define the containment force on the outside.
- Next we create another ramp to define the vortex component of the force direction. We take the result of the cross vector and multiply it with the vortex ramp. Then we can add both the containment vector together with the vortex vector and output it into the outgoing N.
- Next we do it once more for the forward/axial force. So we create an 'axial_ramp' and multiply the negated incoming N with the result of the axial_ramp. Then we can add that together with the other two force direction vectors.

NINTH: Rasterizing the pointcloud.
We reverse the direction of the N on the template points so the force will point forward. Next we rename 'N' (normal) to 'v' (velocity) so we can rasterize v into a vdb vector volume. We create an additional 'density' attribute on the pointcloud and that gets converted into a density vdb which we can use to scatter points.

TENTH: Visualizing the vel field using the volume trail.
Blast everything except the density field and scatter some points. Also blast everything except the v field and connect both to the volume trail which provides a previsualization of the velocity field.

ELEVENTH: Advecting particles.
We create a sphere and scatter some points as the source of the particles. Inside dops we use the 'pop advect by volumes' which uses the 'v' vdb field to advect the particles.

For business or one-on-one visual effects consulting inquiries, you can reach me at [email protected]

Комментарии

Информация по комментариям в разработке