Using 3D models with UVs

UVs are 2D texture coordinates projected onto a 3D surface. UVs define which pixels on a texture map to which vertex on a 3D model. To use texture coordinates in Kanzi Studio, you need to create a UV layout in a content creation tool, such as 3ds Max. This is called unwrapping or UV-mapping. Unwrap your 3D model in flat 2D space to project a texture for that 3D model so that the flow runs from the start to the end of the model. See Preparing 3D assets in third-party tools.

You can use 3D models with UVs in Kanzi Studio with:

To use UVs in your Kanzi Studio project:

  1. Prepare the UV coordinates for your 3D model in content creation software such as 3ds Max. See Preparing 3D assets in third-party tools.
  2. In Kanzi Studio transform the UV texture coordinates using either the Texture Offset property or a custom property. See Transforming UVs with the Texture Offset property and Transforming UVs with a custom property.

Using 3D models with UVs in Kanzi Studio

To use 3D models with UVs in Kanzi Studio:

  1. Prepare the UV coordinates for your 3D model in content creation software such as 3ds Max. See Preparing 3D assets in third-party tools.
  2. In the Assets window click Import Assets, select the UV-mapped 3D model which you want to use, and click Open.

    When you import 3D assets, Kanzi Studio creates for each 3D asset:

    See Importing 3D assets

  3. In the Prefabs select the Scene named after the 3D model you imported in the previous step and double-click it to open it as a composition.
    To see the Scene composition rendered in the Preview, it must contain a camera and at least one light node.
  4. In the Model composition select the Model > RootNode > Model node and in the Properties set the material for the 3D model to the material you want to use for that model. In this example you use a material which supports textures.

Transforming UVs with the Texture Offset property

In Kanzi Studio you can transform UV texture coordinates using the Texture Offset property. When you adjust the value of that property, you transform the coordinates where Kanzi offsets the texture.

To transform UVs with the Texture Offset property:

  1. Prepare the UV coordinates for your 3D model in content creation software such as 3ds Max. See Preparing 3D assets in third-party tools.
  2. In the Prefabs select the Model node and in the Properties add and set:
  3. In the Library > Materials and Textures > Textures select the texture the position of which you control with the Texture Offset property and in the Properties set the Wrap Mode property to Clamp.
    This way there is no texture repetition when the Texture coordinates are offset to values below 0.0 or above 1.0.

Kanzi updates the texture coordinates used in the rendering when the value of the Texture Offset property changes. For example, to create speed gauges, bind the Texture Offset property to a custom property which contains the current speed. When the value of the custom property changes, Kanzi offsets the texture based on the value of that property. See Using bindings.

Transforming UVs with a custom property

In Kanzi Studio you can transform UV texture coordinates using a custom property. When you adjust the value of that property, you transform the coordinates where Kanzi offsets the texture.

To transform UVs with a custom property:

  1. Prepare the UV coordinates for your 3D model in content creation software such as 3ds Max. See Preparing 3D assets in third-party tools.
  2. In the Library press Alt and right-click Property Types, select Property Type and in the Property Type Editor set:
  3. In the Prefabs select the Model > RootNode > Model node and in the Properties add and set:
  4. In the Library > Materials and Textures > Materials select the material you use for the model and in the Properties set the Blend Mode property to Alpha: Premultiplied.
  5. In the Library > Materials and Textures > Textures select the texture you use for the material of the model and set the Wrap Mode property to Clamp.
    This way there is no texture repetition when you adjust the value of the custom property. The UV coordinates of the 3D model work as a canvas for the texture.
  6. In the Prefabs select the Model node, in the Properties add the Bindings property, and in the Binding Argument Editor set:

    This offsets the texture on the x axis based on the value you set in the custom property. You divide the value of the speed by 270.0 because you use that as the maximum value of the speed gauge. You scale the range of the gauge to match the range of the texture coordinate values which go from 0.0 to 1.0. You subtract 1.0 to shift the coordinates out of the 0.0 to 1.0 range and to make the gauge empty when the value of the custom property is 0.
    To offset the texture on the y axis, in the Binding Argument Editor set the Attribute to VECTOR_Y.

When you adjust the value of the custom property, Kanzi offsets the texture on the axis you set in the binding based on the value of that property.

See also

3D assets

Preparing 3D assets in third-party tools

Importing 3D assets

Merging 3D assets