Canvas

The Canvas shape allows you to render images wrapped to box, like a painting. Besides the standard width and height parameters, the shape also provides two additional ones:

  • Width - the width of the original image
  • Height - the height of the original image
  • Thickness - the thickness of the shape
  • Radius - the corners' radius of the shape

They key point here is that the width and height parameters are for the image itself, not the shape. Boxshot uses this dimension and the thickness parameter to compute the shape size that corresponds to such wrapped canvas.

You can click the “Fit to images” button if you’d like Boxshot automatically doing the computations for you.

Scripting

Here’s how you can create a canvas object using script:

var m = scene.root.addMesh("canvas", "generator.canvas.simple");
var g = m.generator;
g.width = 50;
g.height = 20;
g.thickness = 2;
g.radius = 0.1;

Here’s how to automatically fit to image:

var m = scene.root.addMesh("canvas", "generator.canvas.simple");
var g = m.generator;
g.material("Image").diffuseTexture = "/path/to/image.jpg";
g.fitToImages();