How 2D Grid Mode works
master2D Grid Mode is used for products photographed at multiple horizontal and vertical angles. It is automatically detected when you provide filenameGrid or imageListGrid. In this mode, dragging diagonally updates both axes simultaneously.
Using a filename pattern
Use filenameGrid with {indexX} and {indexY} placeholders (1-based indices). You can use indexZeroBase to specify zero-padding (e.g., 3 for 001). Use stopAtEdgesX or stopAtEdgesY to prevent looping on a specific axis.
Using an explicit image list
Alternatively, provide a flat array of image strings via imageListGrid. The images should be ordered by row (all X frames for the first Y angle, then all X frames for the second Y angle, etc.).
// Example: Filename pattern
CI360.init(document.getElementById('viewer'), {
folder: 'https://your-domain.com/images/',
filenameGrid: 'product_{indexY}_{indexX}.jpg',
amountX: 24, // horizontal angles
amountY: 4, // vertical angles
indexZeroBase: 3, // zero-pad to 3 digits: 001, 002, ...
stopAtEdgesY: true, // prevent Y from looping
});
// Example: Explicit image list
CI360.init(document.getElementById('viewer'), {
imageListGrid: [
// y=0 row (all X frames at first vertical angle)
'img_001_001.jpg', 'img_001_002.jpg', /* ... */
// y=1 row
'img_002_001.jpg', 'img_002_002.jpg', /* ... */
],
amountX: 24,
amountY: 4,
});