Embed Code Generator
C Tech provides an Embed Code Generator that builds the HTML snippet for you — fill in your hosting details and copy the result into your page.
How It Works
The embedded viewer loads a lightweight, read-only version of the Scene Viewer inside an IFRAME on your page. Users can rotate, zoom, pan, and interact with the model just like the full viewer, but cannot upload or modify files.
The generated embed code points to viewer.ctech.com/inline_viewer.html with query parameters that identify your scene file and authenticate the request.
Required Information
Before generating an embed code, you need the following:
| Field | Description |
|---|---|
| Scene Filename | The name of your scene file (e.g., myScene.ctws or myBundle.ctmws). Case-sensitive. |
| Domain Hosting Scene File | The full URL of the server hosting your scene files (e.g., https://viewerdemo.ctech.com). |
| Folder Containing Scene File | The subdirectory path on the hosting domain where your files are stored (e.g., clients/myclient). Leave empty if the file is at the domain root. Case-sensitive. |
| API Key | A 16-character hexadecimal key that authenticates requests to your hosting domain. This is provided by C Tech when your hosting domain is configured. |
Viewer Options
The embed generator also lets you configure how the embedded viewer appears:
| Option | Default | Description |
|---|---|---|
| Width | 80% | Width of the embedded viewer. Accepts pixels (e.g., 640) or a percentage (e.g., 80%). |
| Height | 400px | Height of the embedded viewer. Accepts pixels (e.g., 600) or a percentage. |
| Allow Full Screen | On | When enabled, users can expand the viewer to fill their screen. |
| Allow Scene Information | On | When enabled, the information panel is available for users to inspect model details. |
Generated Embed Code
After filling in the required fields, the generator produces an HTML snippet you can copy and paste into your website. A typical embed code looks like this:
The model parameter is a URL-encoded path built from your domain, folder, and filename. The generator handles the encoding automatically.
Tip
The Embed Code Generator remembers your settings between visits, so you only need to enter your domain and API key once.
Tip
To embed multiple scenes side by side, use a .ctmws bundle file. See Multi-Scene Embedding for details.
URL Parameters Reference
If you prefer to construct embed URLs manually, the inline viewer accepts these query parameters:
| Parameter | Required | Description |
|---|---|---|
apikey | Yes | Your 16-character API key |
model | Yes | URL-encoded path to the scene file (domain + folder + filename). Supports both .ctws and .ctmws files. |
include_info | No | Show or hide the information panel (true or false, defaults to true) |