Unicorn 3D parametrizer (PRMT)

Log-in or register.


Parameterizer is one of the Unicorn3D modules. It can be used to add parameters to a 3D model.

What you can achieve with parameters?

3D models with parameters are more flexible and reusable. Parameters can be used for example to:

  • Unify object colors and easily reuse old 3D models when creating icons for a new project that uses different color scheme.
  • Show or hide parts of a 3D model.
  • Simplify creation of animations. You can imagine your parameter represents the "time" and design your 3D model with that in mind.

When converting 3D models to an image in the Rendered image screen, it is possible to define multiple snapshots using one 3D model with different parameter values.

How does it work?

The data representing a 3D model are stored in a hierarchical tree-like structure (resembling files and folders on your computer). The Parametrizer data consist of two sections:

  1. variables
  2. nested 3D model

Simple numeric or textual data items in the nested 3D model can be turned into expressions. More specifically, expressions can be attached to the data items of the nested 3D model. These expressions may use variables defined in the Variables block. When a variable value is changed, the expressions are re-evaluated and the data items of the nested 3D model are updated. Since there may be multiple expressions referencing the same variable, a simple change to the variable value may in turn change numerous data items in the nested 3D model.

rsrc/parametric-3d-model.png image

The 3D model on the above image has 3 parameters called x, y, and paper. The x and y parameters determine how many horizontal and vertical stripes there are, the paper parameter controls whether the interior is filled or not. This 3D model was used when making the icon for the Card Creator, but the same 3D model with different parameters was used to make the 2nd template (ribbon frame) on the Card Creator page.


To add a variable, right-click on the Variables item and select one command from the context menu. There are 5 types of variables:

  • integer number,
  • floating point number,
  • vector (2, 3, or 4 numbers),
  • boolean (yes or no) and
  • string (text).

There is also one special type of variable called iterator that will be discussed later in a separate section.

Variable properties

If you right-clicking on a variable name, you'll see a Variable properties command in the context menu. This command adds or removes two new items from the variable. These items can be used to give a variable a user-friendly name and description. This may be handy if you plan to distribute the 3D model to other people. The name and description are shown on the Rendered image screen when converting the 3D model to an image or an icon.

Integer variable

Integer variables may only have integral numbers as values, both positive and negative.

Integral variable may optionally be limited to a specified range or to a set of options. To enable these constraints, right click on the variable and select either Variable range limit or Variable option names. In the later case, you must enter all option names separates by the | character.

The constraints are visible on the Rendered image screen when the 3D object is used and can help you quickly adjust the parameter values, because it is possible to drag a slider or select a value from a combo box.

Floating point variable

Floating point variable may contain any number and can be limited to a range similarly as the integer variable.

Additionally, floating point variable can be displayed in the 3D view as a point and dragged along the X axis.

Vector variable

Vector variable has 4 sub-types. A 2D vector, 3D vector, 4D vector and color. Right-click on the variable to select its sub-type.

The 2D, 3D, and 4D vectors have 2, 3, or 4 floating point numbers. When used in expressions, the component specifier must be used select the right component of the vector. If the variable is called my_vector, you must use my_vector.x to access the first number of the vector. The other numbers are accessible via .y, .z and .w suffixes.

The color sub-type is similar to the 3D vector, but there are some differences. The suffixes for accessing the components are different: .r, .g and .b. On the Rendered image screen, color variables are represented by a color picker.

Text variable

Text variables may contain text. Unicode characters are allowed.

Boolean variable

Boolean variable may be set to either "Yes" or "No".


Once variables are defined, it is possible to parametrize any numerical, textual or boolean item inside the nested 3D model of the Parametrizer data block.

To parametrize an item, right click on it and choose Parametrize 1st (2nd, 3rd, 4th) number for numerical items or simply Parametrize for textual and boolean items. Because numeric items may have up to 4 components, there are multiple commands and you must parametrize each component separately.

After an item is parametrized, its current value is copied to a newly added textual item that is placed under the active item. This new item accepts expressions and automatically updates the value of the original item.

An expression may contain:

  • numbers, pi
  • "text literals"
  • true, false
  • variables (+component specifiers in case of vectors)
  • rnd, rnd1, rnd2, ... - pseudo-random number generators
  • +, -, /, *, %, ^ operators (% computes reminder after division - 5%3 -> 2)
  • &&, || - logical AND and OR operators
  • if (cond) then sub_expr1 [else sub_expr2]
  • sin(sub_expr), cos(sub_expr), tg(sub_expr)
  • pow(sub_expr1, sub_expr2) - the same as sub_expr1 ^ sub_expr2
  • int(sub_expr) - round down (2.1 -> 2, 3.7 -> 3, -0.4 -> -1, etc.)
  • round(sub_expr) - round to nearest integer (2.1 -> 2, 3.7 -> 4, -0.4 -> 0, etc.)
  • abs(sub_expr) - removes the sign of a number, result is always positive or 0

The sub_expr part can be substituted by arbitrary expression.

Example 1

Suppose you want to parametrize color of your 3D model (or color of some of its parts).

  • First, add a vector variable can name it for example color1. Then right-click on it and set its sub-type to Color. Its icon changes.
  • Next, find the Material section of the component you want to parametrize. Right-click on the Diffuse item and click on Parameterize 1st number. Do the same with 2nd and 3rd number. Expand the item and you'll see 3 new sub-items with the values of the individual color components.
  • Change the value of the 1st parametrized number to color1.r
  • Change the value of the 2nd and 3rd parametrized number to color1.g and color1.b

The color of your component was changed. If you now change the value of the variable, the color of your 3D model changes as well. If you have multiple components in your 3D models and if you want them to always have the same color, parametrize their colors as well and you'll be able to recolor them all at once by changing the variable value.


In the list of variables, iterator looks similarly as an integer variable, but works very differently.

If there is an iterator with value of N, the nested 3D model will be processed and drawn N-times. If there are 2 iterators with values M and N, the nested 3D model will be drawn M*N times. Due to this behavior, using multiple iterators in the same Parametrizer data block can slow down the performance.

What are iterators good for?

Iterators can be used to draw the same or similar 3D object multiple times. Watch the Egyptian pyramid icon tutorial to see how to build a pyramid from a single box that is multiplied using the iterator. Since random numbers generators are available and iterators values can be used in expressions, iterators can be used to create organic objects like rain, fireworks or grass:

icon-image/3768-256x256x32.png image

How to use iterators?

Iterators can be used to position one object along a simple path (line or circle) or to randomly place multiple objects in a predefined volume.

In order to be effective, the iterator must be used inside an expression. If it is not used, the nested 3D object is simply drawn N times on the same spot and the copies will not be visible.

When starting with iterators, it is best to pick the U3D Composer module (the default one) as the nested module and then put some 3D model inside it and parametrize the Transformation item.

By for example parametrizing the X coordinate of a translation with the iterator name as the expression, the nested 3D object will be shown N times (the value of the iterator) along the X axis. Each copy will be shifted by 1 unit. If you used "2*iterator_name" instead, the spacing between copies will be 2 units.

In cases, where it is needed to place N copies into an interval of known size, the expression should look like this: "(iteraror_name+0.5)*interval_size/iterator_name.m". Note the .m suffix - while the value of iterator_name changes in each iteration (starting at 0), the value of iterator_name.m is always the same and equals the number of the iterations.

If you for example parametrize a rotation angle instead of translation component, you can place things in circles or rotate them.

In cases, where you are building a complex object with, where some components are multiplied and others are not, do not place the iterator into the root module. In these cases the structure of your 3D models should look like this:

+ Parametrizer
+ - Root variables
+ + Composer
  + - Component 1
  + + Component 2 (used multiple times)
    + + Parametrizer
      + Variables
      + - Iterator
      + Nested 3D model

Random numbers

When creating organic 3D models, pseudo-random numbers are needed. For example the leaves of grass on the above image are randomly placed and positioned and their color is randomly adjusted.

To use a random number in an expression, simply use the rnd1, rnd2, rnd3, etc. pseudo-variables. When one of these is used, its value is a random number in range 0-1. While the number is random, it is also constant. rnd1 in first iteration will always have the same value and hence the 3D model using random numbers will look the same each time it is displayed or opened. The value of rnd1 is of course different in each iteration.

Recent comments

user icon Anonymous
What about ICL files?
Vista & Win 7 icons