Patterns are the basic building blocks for our models. In this tutorial we will explain what they are, and go from the basics all the way to advanced functionality.
Create a New Project
Start by creating a new project by clicking on
File -> New Project, and then choose a location to save your project. We will call our project
tutorial1. Waveform will then create the directory structure and present us with a blank workspace.
Note that Waveform will first create a solution directory with your specified name, and then put the project inside of that. So in our case, it will generate
(1 / 4) Creating a Sphere
The next thing to do is add a workspace item, so we can begin building a pattern. To do this click on the
icon on the
Workspaces toolbar and select
Add Pattern. Give it a name such as
Sphere and click
OK. You should then see this in your editor:
This is the default pattern setup, and is added for you so you can hit the ground running. In this image you can see I have selected the root block because of the yellow border. Select the root block yourself to generate the sphere in the
By selecting the block, Waveform ran through the block set and generated the sphere model. Lets now work through the blocks row by row to understand what they are doing:
In Waveform we call the basic shapes
patterns. These are always started with a pattern header block, which tells us the name and has an optional comment on the right. You can edit the name by clicking on it and selecting
This is the most important command in the process, and describes the curve used to generate the sphere. To see the curve click on the icon:
This brings up the curve editor, which shows us the curve used by both the
Scale components of the process. Try dragging the points around and see how the 3d model changes in response. Once done, click
Cancel to exit this screen.
There is a lot going on on this block we haven't covered yet, so let's go throug them now. As a process is sequential, lets go through in the order that Waveform will actually process the curve:
|1||The user created curve, to convert to 3d.|
|4||The left hand side block also has it's own command, and this time we take the
|5||The curve to use the values for. During generation, we can specify the
Every model needs at least a
Scale curve, and as can be seen we specify the
Scale curve next:
Here we actually re-use the same curve the position uses, but if you look at the left hand side command we have
YYY instead. This means it takes the
Y component of every point on the curve, and uses that value for the
Z channels. The result is the same half-circle scale is used on all 3 axis', which is what we want to generate a sphere.
So far we've specified the path to take and the scale to use, but we've yet to specify a 2d surface to actually extrude along this path. This is what this block does; if you click on the icon again you will see a circle:
This is what will be extruded along the position curve. We can imagine that this would produce a cylinder, if it wasn't for the scale curve making it smaller at the beginning, biggest in the middle, and small again at the end, producing a sphere.
This block is what actually tells the engine to generate the model. Up to now we've just been specifying what curves and surface to use. This block will actually begin the generation process with that information. You can test this by selecting the block and dragging it away to disconnect it, and the model will disappear.
:end command tells the engine to iterate all the way to the end of the position curve. Later we will see that we can specify custom stop points, so we change the surface before continuing. This is where the blend value comes in handy.
This final block specifies the rigid body to generate for physics calculations. You can view it by clicking on
View -> PhysicsBodies in the
3d View. Try selecting
Enable... -> Enable Physics too to see the ball fall under gravity. We will cover physics in more detail later in the
(2 / 4) Creating a Cylinder
In this example we'll go over editing the workspace, to convert our Sphere to a Cylinder. In order to create a Cylinder we could edit our existing curve to be a straight line, and let the commands take care of the rest. Or, we could add a new curve just for the scale.
We will take the second approach to explore new functionality. On the left of the workspace we have the toolbox, which lists a set of categories. By clicking on the
Patterns category we are shown a set of blocks that we could use for creating patterns with. Drag out the
[Curve] block, and replace the
[Use Position Curve] block with it, so you get this workspace:
Alternatively a faster, and more convenient way, of creating the curve block would be to right click the existing position curve and select
duplicate from the context menu.
Note you can add as many blocks as you want to a single workspace, but to keep your project simple, it is better to have each set of blocks under it's own heading in the workspaces list, so you can quickly navigate between them.
Open the Scale Curve Editor, and select the line and move it up in the Y axis. You should see this creates a Cylinder that gets bigger as you increase the Y value.
The Curve Editor
This is where the main work happens to design patterns in Waveform. The idea is you can specify curves with as many points as you like, and the engine will interpolate the curves to create the final 3d mesh. You can double click on any part of a line to create a new point, and so modify the curve in new ways. By clicking on a point you get 2 handles which can be used to rotate the curve path. Here is an example:
Play around with the curve to see what else you can create. Hold down
ALT while moving the mouse around to auto select nearby points, so you can see their information quicker.
Note that your Cylinder has two empty holes on either side of it, because the scale starts at a non-zero value and ends on a non-zero value too. To fix this you generally always need to start the scale from zero and end on zero, in order to generate a closed shape.
(3 / 4) Creating Teeth
One advanced usage is to take a pattern you have generated, and tell it to also generate itself across a curve you have specified. This can be useful for creating teeth for example. To see this in action open the
patterns tutorial project, and click on the teeth pattern item.
The block set contains the
Add Process block, which allows you to add a pattern at each point on the
Position curve instead. The added pattern also gets a new rotation value, as well as has it's
bend_point modified. To understand the values better try changing them.
15 Uniform Samplesare taken as well. This is useful for when you don't want Waveform to calculate the most optimised set of points for you, but instead want it to take a number of equally spaced points along the curve.
(4 / 4) Multiple Surfaces
The sample also includes a way to change the extrude surface as you iterate along a position curve. Open the
multi_surface item in the tutorial project to see how this can be used to create more complex shapes:
Try playing around with the blend values to see how they affect how jagged or smooth the transition is from one surface to the next. Look at the
SportsCar sample for another use of blending.