Skip to content

Commit 8d6232e

Browse files
camera position, target and background color moved to common settings
1 parent 73cadd5 commit 8d6232e

File tree

3 files changed

+222
-216
lines changed

3 files changed

+222
-216
lines changed

docs/learn/3d-bits/tutorials/bitbybit-runner/settings.md

Lines changed: 26 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ All editors are accessible through the **3D Bits admin dashboard** in your Shopi
5454
- [Enable Key Event Listeners](#enable-key-event-listeners)
5555
- [Fonts to Include](#fonts-to-include)
5656

57-
### Visual Configuration
58-
- [Runner CDN Link](#runner-cdn-link)
59-
- [Camera Position](#camera-position)
60-
- [Camera Target](#camera-target)
61-
- [Background Color](#background-color)
62-
63-
### Global Settings
64-
- [Show Spinner](#show-spinner)
65-
- [Receive Input Names As Variants](#receive-input-names-as-variants)
66-
- [Input Collection Mode](#input-collection-mode)
67-
- [Enable Debug Mode](#enable-debug-mode)
68-
- [Disable Inputs When Computing](#disable-inputs-when-computing)
69-
- [Try to Prepend](#try-to-prepend)
70-
- [Prepend With Query Selector](#prepend-with-query-selector)
71-
- [Remove Children Before Prepend](#remove-children-before-prepend)
72-
- [Show Fullscreen Button](#show-fullscreen-button)
57+
### Common Settings (Viewer & Runner)
58+
- [Camera Position](#camera-position) - [See full documentation](../getting-started/common-settings#camera-position)
59+
- [Camera Target](#camera-target) - [See full documentation](../getting-started/common-settings#camera-target)
60+
- [Background Color](#background-color) - [See full documentation](../getting-started/common-settings#background-color)
61+
- [Runner CDN Link](../getting-started/common-settings#runner-cdn-link)
62+
63+
### Common Settings (All Blocks)
64+
- [Show Spinner](../getting-started/common-settings#show-spinner)
65+
- [Receive Input Names As Variants](../getting-started/common-settings#receive-input-names-as-variants)
66+
- [Input Collection Mode](../getting-started/common-settings#input-collection-mode)
67+
- [Enable Debug Mode](../getting-started/common-settings#enable-debug-mode)
68+
- [Disable Inputs When Computing](../getting-started/common-settings#disable-inputs-when-computing)
69+
- [Try to Prepend](../getting-started/common-settings#try-to-prepend)
70+
- [Prepend With Query Selector](../getting-started/common-settings#prepend-with-query-selector)
71+
- [Remove Children Before Prepend](../getting-started/common-settings#remove-children-before-prepend)
72+
- [Show Fullscreen Button](../getting-started/common-settings#show-fullscreen-button)
7373

7474
## Script Configuration Settings
7575

@@ -572,96 +572,29 @@ This is a common setting shared across multiple blocks. See the [Common Settings
572572
573573
### Camera Position
574574
575-
**Default:** `[30, 10, 30]`
576-
577-
Camera Position defines where the 3D camera is located in the scene's coordinate system.
578-
579-
#### Format
580-
581-
Provide a vector3 array in the format `[x, y, z]`:
582-
- **x** - Left/Right position (negative = left, positive = right)
583-
- **y** - Up/Down position (negative = down, positive = up)
584-
- **z** - Forward/Backward position (negative = backward, positive = forward)
585-
586-
#### Default for Runner
587-
588-
The default `[30, 10, 30]` is further back than the VIEWER default `[3, 1, 3]` because parametric geometry often spans a larger area.
589-
590-
#### Examples
591-
592-
```json
593-
[30, 10, 30] // Default: Far view for large generated geometry
594-
[10, 5, 10] // Closer view for smaller objects
595-
[0, 20, 0] // Top-down view directly above
596-
[-15, 10, 15] // View from the left side
597-
```
598-
599-
#### Dynamic Camera Control
575+
This is a common setting shared with the VIEWER block. See the [Common Settings: Camera Position](../getting-started/common-settings#camera-position) documentation for detailed information.
600576
601-
Your parametric scripts can also control the camera programmatically through both **Low-Code** (Blockly/Rete) and **Pro-Code** (TypeScript in Monaco editor). This allows you to:
602-
- Adjust camera position based on generated geometry size
603-
- Create animated camera movements
604-
- Define custom camera behaviors per variant
577+
:::tip RUNNER-Specific Default
578+
For the RUNNER block, the default camera position is `[30, 10, 30]` - further back than the VIEWER default because parametric geometry often spans a larger area.
579+
:::
605580
606581
---
607582
608583
### Camera Target
609584
610-
**Default:** `[0, 15, 0]`
611-
612-
Camera Target defines the point in 3D space that the camera looks at.
613-
614-
#### Format
615-
616-
Provide a vector3 array in the format `[x, y, z]`:
617-
```json
618-
[0, 15, 0] // Looking 15 units up from origin (default)
619-
[0, 0, 0] // Looking at the origin
620-
[10, 5, 10] // Looking at a custom point
621-
```
622-
623-
#### Default for Runner
624-
625-
The default `[0, 15, 0]` targets a point elevated from the origin, suitable for typical parametric objects that extend vertically.
626-
627-
#### How It Works
628-
629-
Combined with [Camera Position](#camera-position), this defines the viewing angle:
630-
- **Camera Position** = Where the camera is located
631-
- **Camera Target** = What the camera looks at
585+
This is a common setting shared with the VIEWER block. See the [Common Settings: Camera Target](../getting-started/common-settings#camera-target) documentation for detailed information.
632586
633-
#### Dynamic Control
634-
635-
Like camera position, your scripts can control the camera target programmatically to automatically frame generated geometry.
587+
:::tip RUNNER-Specific Default
588+
For the RUNNER block, the default camera target is `[0, 15, 0]` - targeting a point elevated from the origin, suitable for typical parametric objects that extend vertically.
589+
:::
636590
637591
---
638592
639593
### Background Color
640594
641-
**Default:** `#ffffff` (white)
642-
643-
Canvas background color for the 3D viewer.
644-
645-
#### Format
646-
647-
Provide a hex color code:
648-
```
649-
#ffffff // White (default)
650-
#f0f0f0 // Light gray
651-
#2c3e50 // Dark blue-gray
652-
#000000 // Black
653-
```
654-
655-
#### When to Change
595+
This is a common setting shared with the VIEWER block. See the [Common Settings: Background Color](../getting-started/common-settings#background-color) documentation for detailed information.
656596
657-
Match your theme's color scheme:
658-
- **Light themes** - Use white or light gray backgrounds
659-
- **Dark themes** - Use dark gray or black backgrounds
660-
- **Brand colors** - Use subtle brand-aligned colors
661-
662-
:::tip
663-
Neutral backgrounds (white, light gray) work best for showcasing parametric geometry, as they don't distract from the 3D content.
664-
:::
597+
---
665598
666599
## Global Settings
667600

docs/learn/3d-bits/tutorials/bitbybit-viewer/settings.md

Lines changed: 22 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@ You'll find the BITBYBIT VIEWER settings in your theme editor after adding the b
1919
### Product-Specific Settings
2020
- [Model URL](#model-url)
2121
- [Scene JSON Configuration](#scene-json-configuration)
22-
- [Camera Position](#camera-position)
23-
- [Camera Target](#camera-target)
24-
- [Background Color](#background-color)
2522

26-
### Global Settings
27-
- [Runner CDN Link](#runner-cdn-link)
28-
- [Show Spinner](#show-spinner)
29-
- [Receive Input Names As Variants](#receive-input-names-as-variants)
30-
- [Input Collection Mode](#input-collection-mode)
31-
- [Enable Debug Mode](#enable-debug-mode)
32-
- [Try to Prepend](#try-to-prepend)
33-
- [Prepend With Query Selector](#prepend-with-query-selector)
34-
- [Remove Children Before Prepend](#remove-children-before-prepend)
35-
- [Show Fullscreen Button](#show-fullscreen-button)
23+
### Common Settings (Viewer & Runner)
24+
- [Camera Position](#camera-position) - [See full documentation](../getting-started/common-settings#camera-position)
25+
- [Camera Target](#camera-target) - [See full documentation](../getting-started/common-settings#camera-target)
26+
- [Background Color](#background-color) - [See full documentation](../getting-started/common-settings#background-color)
27+
- [Runner CDN Link](../getting-started/common-settings#runner-cdn-link)
28+
29+
### Common Settings (All Blocks)
30+
- [Show Spinner](../getting-started/common-settings#show-spinner)
31+
- [Receive Input Names As Variants](../getting-started/common-settings#receive-input-names-as-variants)
32+
- [Input Collection Mode](../getting-started/common-settings#input-collection-mode)
33+
- [Enable Debug Mode](../getting-started/common-settings#enable-debug-mode)
34+
- [Try to Prepend](../getting-started/common-settings#try-to-prepend)
35+
- [Prepend With Query Selector](../getting-started/common-settings#prepend-with-query-selector)
36+
- [Remove Children Before Prepend](../getting-started/common-settings#remove-children-before-prepend)
37+
- [Show Fullscreen Button](../getting-started/common-settings#show-fullscreen-button)
3638

3739
## Dynamic vs. Global Settings
3840

@@ -208,128 +210,27 @@ The system automatically detects if you're providing a URL (starting with `http:
208210

209211
## Camera Position
210212

211-
**Default:** `[3, 1, 3]`
212-
213-
Camera Position defines where the 3D camera is located in the scene's coordinate system. This determines the initial viewing angle of your model.
214-
215-
:::warning Scene Configuration Override
216-
If you're using [Scene JSON Configuration](#scene-json-configuration), spinner settings defined in the scene config will take precedence over this setting. You can create and manage scene configurations using the [Viewer Editor](/learn/getting-started/viewer-editor/intro).
217-
:::
218-
219-
### Format
220-
221-
Provide a vector3 array in the format `[x, y, z]`:
222-
- **x** - Left/Right position (negative = left, positive = right)
223-
- **y** - Up/Down position (negative = down, positive = up)
224-
- **z** - Forward/Backward position (negative = backward, positive = forward)
225-
226-
### Examples
213+
This is a common setting shared with the RUNNER block. See the [Common Settings: Camera Position](../getting-started/common-settings#camera-position) documentation for detailed information.
227214

228-
```json
229-
[3, 1, 3] // Default: Viewing from front-right, slightly elevated
230-
[0, 2, 5] // Directly in front, higher up
231-
[-2, 1, -2] // Behind and to the left
232-
[10, 0, 0] // Far to the right, at ground level
233-
```
234-
235-
### Finding the Right Position
236-
237-
1. Start with the default values
238-
2. Adjust based on your model's size and orientation
239-
3. Combine with [Camera Target](#camera-target) to frame your model perfectly
240-
241-
:::tip
242-
Larger values move the camera further from the origin (0, 0, 0). If your model appears too small or too large, adjust the distance by scaling all three values proportionally.
215+
:::tip VIEWER-Specific Default
216+
For the VIEWER block, the default camera position is `[3, 1, 3]` - a closer view suitable for pre-made 3D models.
243217
:::
244218

245219
---
246220

247221
## Camera Target
248222

249-
**Default:** `[0, 0, 0]`
250-
251-
Camera Target defines the point in 3D space that the camera looks at. This is sometimes called the "look at" point.
252-
253-
:::warning Scene Configuration Override
254-
If you're using [Scene JSON Configuration](#scene-json-configuration), camera settings defined in the scene config will take precedence over this setting. You can create and manage scene configurations using the [Viewer Editor](/learn/getting-started/viewer-editor/intro).
255-
:::
256-
257-
### Format
258-
259-
Provide a vector3 array in the format `[x, y, z]`:
260-
```json
261-
[0, 0, 0] // Looking at the origin (default)
262-
[0, 1, 0] // Looking 1 unit up from the origin
263-
[2, 0.5, 1] // Looking at a custom point
264-
```
265-
266-
### How It Works
267-
268-
The camera will always point toward this target position. Combined with [Camera Position](#camera-position), this defines the viewing angle:
269-
- **Camera Position** = Where the camera is
270-
- **Camera Target** = What the camera looks at
271-
272-
### Example Setup
273-
274-
For a product sitting on a table:
275-
```json
276-
// Camera Position
277-
[3, 2, 3] // Camera positioned above and to the side
223+
This is a common setting shared with the RUNNER block. See the [Common Settings: Camera Target](../getting-started/common-settings#camera-target) documentation for detailed information.
278224

279-
// Camera Target
280-
[0, 0.5, 0] // Looking at the center of the product
281-
```
282-
283-
:::info
284-
If your model isn't centered at the origin, adjust the camera target to point at your model's center. You can find the model's center coordinates by loading it in a 3D software like Blender.
225+
:::tip VIEWER-Specific Default
226+
For the VIEWER block, the default camera target is `[0, 0, 0]` - looking at the origin where models are typically centered.
285227
:::
286228

287229
---
288230

289231
## Background Color
290232

291-
**Default:** `#ffffff` (white)
292-
293-
Sets the background color of the 3D canvas. This creates the environment color behind your 3D model.
294-
295-
:::warning Scene Configuration Override
296-
This setting is disabled if you're using [Scene JSON Configuration](#scene-json-configuration). Scene configurations support advanced backgrounds including:
297-
- Solid colors
298-
- Linear gradients
299-
- Radial gradients
300-
- Background images
301-
- Skyboxes (HDR environments)
302-
303-
You can configure these advanced backgrounds using the [Viewer Editor](/learn/getting-started/viewer-editor/intro).
304-
:::
305-
306-
### Usage
307-
308-
Provide any valid CSS color by using a color picker.
309-
310-
### Best Practices
311-
312-
Choose a background color that:
313-
- Matches your theme's design
314-
- Provides good contrast with your 3D model
315-
- Complements your product photography style
316-
317-
:::warning Priority Order
318-
Background settings are applied in this priority order (highest to lowest):
319-
1. Scene JSON Configuration (skybox or advancedBackground)
320-
2. Scene JSON Configuration (backgroundColor)
321-
3. This block setting
322-
323-
If you're using Scene JSON Configuration with skybox or advanced backgrounds, this setting will be ignored.
324-
:::
325-
326-
### Examples
327-
328-
```
329-
#ffffff // Clean white background
330-
#f5f5f5 // Subtle gray
331-
#000000 // Dramatic black background
332-
```
233+
This is a common setting shared with the RUNNER block. See the [Common Settings: Background Color](../getting-started/common-settings#background-color) documentation for detailed information.
333234

334235
---
335236

0 commit comments

Comments
 (0)