advanced

Using Decals


Table of contents
* [Decals](#decals)

Decals

These are usually used to add details on meshes (bullets hole, local details, etc...), a decal is a mesh produced from a subset of a previous one with a small offset in order to appear on top of it.

Creation Example :

var decal = BABYLON.MeshBuilder.CreateDecal("decal", mesh,  {position: myPos}, scene);

Don't forget the mesh parameter; this is the mesh to which the decal is applied.

Properties, all optional :

property value default value
position (Vector3) position of the decal (World coordinates) (0, 0, 0)
normal (Vector3) the normal of the mesh where the decal is applied onto (World coordinates) Vector3.Up
size (Vector3) the x, y, z sizes of the decal (1, 1, 1)
angle (number) the angle to rotate the decal 0

A Playground Example of Decals -


click on the cat.

Further Reading

Basics

Standard Shapes

Intermediate

Additional Shapes