Gerbera Tutorial
This tutorial provides an introduction to using ‘Xfrog 4 for CINEMA 4D’.
(Please Note: Unless you have already purchased Xfrog 4 for CINEMA 4D, you will need to download and install the 30-day demo version before beginning this tutorial). More information about Xfrog 3.5 standalone, Xfrog 4 for CINEMA 4D, and details regarding the 17 XfrogPlants Libraries is available at http://www.xfrog.com. The complete CINEMA 4D project folder for this tutorial, including the model of the Gerbera (pictured above), can be downloaded at http://ww.xfrog.com/temp/gerbera.zip
Tutorial for Xfrog 4 : Gerbera (Gerber Daisy)
PART 1: Textures
Choose
a plant you wish to model, then scan the different parts of the plant. This
may include: one or two leaves (the plant on the reference doesn't have any,
but in nature they have leaves); one or two petals; the middle of the blossom;
the calyx (from the side); and a part of the stalk.
Make sure that the background is a solid color, and different from the object
you are scanning. Additionally, the background should not reflect light on the
subject. These scanning tips will help you create an alpha channel (also known
as “matte”, “key”, or “mask”) when preparing
the scans for Xfrog. You can use any bitmap editor that creates supported RGBA
images. We will use Adobe© Photoshop© to edit our images.
The leaves
You can isolate
the leaf with any tool or combination of tools available in Photoshop (eraser,
lasso, “quick mask” painting or the Extract filter) to prepare the
image for use as an Xfrog texture. Consult your image editing software manual
for specific instructions.
The leaf must be placed in the middle of the canvas, with
the cut side at the bottom edge of the frame.
Save this image in a format that supports an alpha channel. (for example: .TIF,
.TGA, .PCT)

The Middle of the Blossom
Following the steps used for the leaves, isolate the middle of the blossom and save the image with an alpha channel.
The
Calyx
The calyx should be scanned from the side. Next, prepare it in Photoshop so that it fits seemlessly on top of the stalk. The sepals at the top part of the calyx have to be separated from the petals with an alpha channel.

![]()
The Stalk
The scan of the flower’s stalk has to be prepared to wrap seamlessly around the 3D stalk. To create the seamless image, first cut out a relatively homogeneous section of the image. By using Photoshop’s “Offset” filter (Filter->Other->Offset), displace the image using “Wrap Around”. Using horizontal and vertical offset values that are exactly half of the image’s pixel size will give you the best results. Paint the edges of the stalk to prevent noticeable repetition in your texture. Apply the “Offset” filter again to make sure you have not created any new seams.
Now that you have all of your textures created, have fun modeling your plant!
PART 2: Modeling
Creating the Stalk
Begin by creating an Xfrog Branch object (Plugins > Xfrog4 > Branch). This represents the stalk. Set the Thickness property to a uniform 100% by deleting the intermediate control points and setting the end point to 100% (Select control points, then choose from the contextual menu [cmd-click or right-click point]). Set the Circle’s radius to 20m. Create 2 new Null Objects in the 3rd and 4th position of the hierarchy. Name them “Leaves” and “Blossom” (or “Blaetter“ and “Bluete“) (This is not only an Xfrog tutorial, you will learn German too!). The third place is reserved for multiple links, objects that have to be multiplied (branches, leaves...). The fourth place is for single-linked objects, like our blossom.
Texturing the Stalk
In the materials manager, create a new material. Name this material “Stalk”. Load the scanned stalk texture inside the color channel, drag onto the stalk and change the Y length to 50%.

Creating Leaves
Next, create a new branch. Name it “Leaf” (or “Blatt”). As before, the thickness has to be 100%. Delete the Circle spline. With the front view selected, draw a profile of the leaf with a spline tool. For our example, we’ll use a simple spline with two points. (0.0.0 and 400.0.0). On the Length spline, change the Y values to 0, 300, 500. The “Leaf” branch should look like an untextured plane. Rename the top spline: “profile”, the bottom spline: “length”.

Next, create a new material. In the color channel and alpha channel, load the bitmap image you created from the scanned image. Disable the option for “Soft”. Check the activation box for “Invert”. To refine the texture, lower the height of the specularity and copy the leaf texture into the bump channel of the texture.

For a better looking render, using the bhodiNUT Fusion shader, create a custom luminance channel for this texture. In the base channel, load the leaf image. In the blend channel, load the bhodiNUT Banj Shader, with an illumination of 100% and a white color (step 3). The brightness of the illumination channel should equal 0% and the mix controller at 75%.

Finally finish the leaf by dragging the material onto the “Leaf” (“Blatt”) branch. The texture may appear upside down. One way to solve this is to select the texture tag and set the Y-Length value to 100% in the attributes manager. Next, drag the entire “Leaf”(“Blatt”) branch onto the “Leaves” (“Blaetter”) null object. The leaves are now distributed along the stalk, but it seems as if the profile of the leaf is on edge. Additionally, the leaf texture appears clipped.



Activate the leaf object and deactivate Inherit Thickness and Inherit Growth. To align the center of the leaf with the stalk, move the object’s position, x= (-200) (remember: our texture is centered, and our profile spline’s point 2 = x.pos = 400; so LEAF BRANCH x.pos = 1/2*length of profile).

In nature, leaves are under the influence of gravitropism and hang down. We can simulate this effect by dragging a Tropism object onto the leaf’s Lenth spline. With the Tropism object selected, open the attribute manager and select (-Y) for Axis. Increase the right control point for Intensity. Leaves don’t usually grow straight out of the stalk. To change this, select the Main Branch (stalk) and drag the second control point down on Node Angle (under Nodes subsection). You can make more precise changes later.
![]()

Adding Leaf Variation
As our plant should have two different kinds of leaves, we have to change our
hierarchy a little bit. For that we first drag the leaf out of the hierarchy,
copy it (Ctrl-drag or copy/paste) and rename the copy “Leaf 2” (“Blatt
2”). Copy the first leaf texture and rename it Leaf02. Change the image
channels in the Leaf02 texture to the small leaf (blattklein01.tif). This new
texture will now be used on “Leaf 2” (“Blatt 2).
![]()

Create a Variation object, and drag it under the “Leaves” null. By default, the variation object will choose randomly from the children objects. We want the big leaves to appear at the bottom of the stalk, with the smaller leaves toward the top. Select the Variation object and select the “Spread” type in the attribute manager. Using the parent branch’s Node Scale, we can adjust the size of the produced leaves.

Creating the Blossom Elements
The Calyx
Last is the blossom. Copy the master branch (stalk) and delete the Variation object and children from the duplicate. Name this duplicated branch “Calyx” (“Kelch”) drag it to the Blossom null (“Bluete”/Bluetenposition).

Don’t worry that nothing has happened in the view window. The growth node of the stalk object is set to 0% at the top. The calyx won’t grow until we deactivate the inherit growth parameter in the Calyx (kelch) object’s attributes.

The length of the calyx has to be adjusted to be proportional to the size of the stalk, for this, reduce the height of the spline from 2000 to around 110. (Note: By default, Xfrog creates branches whose splines contain 3 points with Y values of 0, 1000, 2000. For the calyx, you’ll want to delete the second point before making the structural change). With the aid of the Thickness curve parameter we shape the calyx. To gain greater control over the curve, insert new control points by right-clicking the curve for the contextual menu (or ctrl-click to directly apply points).

Create a new material, using the calyx scan. Map this texture onto the Calyx (kelch), remembering to change the length of the tag to Y=(-100%).
The Blossom
Copy “Leaf” (Blatt) and rename it “Petal 1” (“Blütenblatt 1”). Next, as before, create a new material for the red petal. Drag the new texture onto “Petal 1”. The image seems a little wide. Change the profile spline’s second point to X=175 (Alternatively, you can change the shape by editing the object’s Thickness curve.)

To create a random appearance in the blossom, copy the petal and rename it “Petal 2” (Blütenblatt 2”). Apply the alternate petal texture to the new object. To arrange the petals in a circle, create a Variation object and a Hydra object. Place the two petals inside the Variation object, and the Variation object inside the Hydra object.



As the petals are arranged in the wrong way right now, we have to rotate the hydra object 90° around the Z-axis. Now the petals have to be rotated individuallly by setting the control points of the spin parameter to 90° using parameter controls inside the hydra object. In a real blossom the petals tend to grow to the sky and don't lay parallel to the bottom. Change the twist parameter in both control points to 40°.

Advanced
Functions
To get more randomness in the spin of the petals, select the Spin parameter, then right-click (or cmd-click) on Spin and choose “Show Subchannels“.
Now
we insert the function x+rnd(0.05). In this function, “x” reads
the value from the curve, a random value is created by “rnd”(value
range). Randomly generated numbers between -0.05 an 0.05 are generated, which
now will be added to the referenced “x” value. The same you can
try with the twist parameter or a combination of both.
Adding the Center
The last missing thing is the center of the blossom. Create a disc primitive. Create a new material with the scan of the center, using the previous method to create the separate channels. Add the “center” texture to the disc. Change the object attributes of the disc to Rotation Segments=16.

Make the disc editable (Structure->Make editable, shortcut “c”). Using the edge tool, select one of the external edges. Use edge loop to select the rest of the edges of the disc. Drag this selection up (+Y). Select the second ring and drag it up slightly, not as far as the outer edge. Using the polygon mode, select the center polygons and move them up. Place the entire disc object into a HyperNURBS object to subdivide and smooth the model.


To finish modelling the center, move the object up in Y-space. It should conceal the leading edges of the petals.
Now you can drag the Hydra-Petal object and the Center NURBS object to the Null object named "Blossom" ("Buete") in the hierarchy of the calyx. You may need to position this object so the petals fit within the calyx object.
Xfrog offers several other tools, including these to help you integrate your Xfrog objects into your 3D scenes.
More tips for compositing your scene
Depth of field
The depth of field from C4D may cause problems, especially if you have objects
using alpha channels in your scene - like our flower. The same applies to objects
with transparency values.
There is a relatively easy trick to calculate a map of the depth of field, which
can be used in Adobe© Photoshop© or After Effects© to simulate
a DOF effect afterwards.
To complete the trick, the color channel has to be set to black in each of the active materials. All of the other channels with exception of the alpha channels (if there is one) must be deactivated. In the Luminance channel use the bhodiNUT Proximal Shader for all of the materials in your scene. The Proximal shader produces a black and white render based on the objects distance from the camera. The scene in the “Gerbera_depth” file uses this principle. You can use this file to look at the different settings for the Proximal shader.
If you are happy with the resulting gradient, render the scene and use the
resulting image as alpha channel in Photoshop/After Effects to control the strength
of the blur effect.

The Blue Vases
The blue vases were generated using a Lathe NURBS object. The spline describes
the outline of the vase and is rotated around the Y-axis. The transparent glass
vase was modeled from a cube using Structure/Extrude, and smoothed by a HyperNURBS
Object.
This tutorial focuses on the creation of the flower object. To learn about modeling
objects using Cinema 4D, check the support
pages at Maxon’s website at http://www.maxon.de.