C4Dforbeginners

Compare Node

A Compare Node compares the values of the data arriving at its two Input Ports using one of several available comparison operators such as "equals" (=), "greater than" (>). Here, the operator is "less than" (<) as can be seen in the Node's Attributes : Node button). The value at the Node's Input 2 has been set at 500m (Attribute Manager > Parameter button). This node therefore calculates whether the distance between the Gun Mouth Object and the Ship Object is less than 500 m and if so it produces a True Boolean value at its Output Port, otherwise a False Boolean value. (The value arriving at Input 2 set in the Attribute Manager as mentioned could alternatively be set by a Constant Node, several of which are described in Walkthrough No. 1)

PStorm Again

The Output of the Compare Node (Boolean value True or False) is Linked to the On Input Port of the PStorm Node (see above). If that value is True, the PStorm emits particles, otherwise it does not. The Output Port of PStorm is linked to the PShape Node. A PShape Node (if present) specifies what Object will be used as the particles emitted by PStorm. (If not present, PStorm emits small indicators in the Viewport of the position of each particle to allow debugging which do not appear in the rendered image.) For the PShape Node, the Attribute Manager > Parameter button shows that the Shell Object is specified (this was done by dragging the name of the Shell Object into the Object Field in the Attribute Manager of PShape). However, before dragging an Object like that it must be the Child of a Particle Geometry Object which can be found in Cinema's Menu Bar > Plugins > Thinking Particles > Particle Geometry.

Collision Detection

We now need to consider how the Expression detects collisions between a Shell Object and the Ship Object.

PPass Node

A PPass Node passes information at its Output Port about each particle that is emitted by PStorm - I think that this information includes its position and orientation, its "serial" number, and probably much else. This is to allow following nodes to "know" which particle to process. (The "All" refers to all the particles emitted by PStorm - it is possible to divide particles into Groups, each with a name, and to process particles in each Group differently from those in other Groups, but here we have only one Group, called "All" by default.)

PDeflector Node

This information is passed to the PDeflector Node which produces at its Event Output Port a momentary Boolean value True or False every time a collision occurs. Its settings are numerous and require attention to the manual and much experimentation. Change only one setting at a time otherwise you will not know which has produced which result.

PFragment

This Boolean value is then delivered via a Link to the On Input Port of the PFragment Node which, if the value is True, initiates the process of fragmentation of the particle which has just collided. (PFragment has also to have passed to it the information from PPass for the same reason as PDeflector has passed to it the information.) PFragment's settings are also numerous and need experimentation.

Explosion FX

This is an Object in the Object Manager and can be found in Cinema's Main Menu > Scene > Deformation > Explosion FX. It could be present in the Expression as a Node (by dragging its name in the Object manager into the Xpresso Editor window) where a large number of its parameters could become available for control etc. by Xpresso, but in this case the explosion is simply programmed by settings in its Attributes and triggered by the animation reaching a certain Frame number.

Movie

Make a movie of the Scene to see the full effect.