Rectangle | A flat, rectangle shaped mesh primitive. By far the most frequently used geometry in a typical Ventuz scene. | |
Rounded Rectangle | Similar to Rectangle but each corner individually can be made either rounded or sharp. | |
Gradient Rectangle | Similar to Rectangle but can be assigned two color values to create a resolution independent gradient. |
The Rectangle is easily the most often used primitive, usually in conjunction with a texture assigned to it. It is great for rendering buttons, menu bars or other navigational elements which are more easily created in a 2D painting application than with a 3D modeling program.
There are a number of situations where the user may want to map different images to a Rectangle but the specific size of the images is not known in advance. By activating the Normalize Property, the Rectangle automatically adjusts its size so that the larger of the two X/Y properties is scaled down to one and the other follows proportionally. This way the actual rectangle geometry will always be somewhere in the unit square around the origin.
Usually this is used by binding the X/Y size properties of the Rectangle to the X/Y output properties of an Image Loader node. Regardless of what dimension the loaded image is, the image will always be mapped with the correct aspect ratio in the unit square around the origin.
The Rounded Rectangle inherits most of its Properties from the standard Rectangle. In addition, it provides four Boolean flags that indicate whether or not each of the four corners should be rounded. The radius of the rounded corner is specified by RoundedSize.
The construction of the Rounded Rectangle is more similar to a rectangle with a boundary around it than a rectangle from which the corners have been subtracted. Using the Filled flag, the inner part can be removed to use the Rounded Rectangle for example as an image frame.
A number of Texture modes have been added to address certain use cases:
The idea behind the latter two is to create a texture which contains a 3D button and by using the two texture modes, the geometry can be adjusted while the button correctly stretches.
Instead of baking a gradient into a texture and mapping it onto a Rectangle, a Gradient Rectangle can be used directly. The main advantage is that the Gradient Rectangle does not use a texture but rather assigns color values to the vertices of the tessellation and lets the hardware worry about smoothly interpolating between those values.