Embed Code Generator

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:

FieldDescription
Scene FilenameThe name of your scene file (e.g., myScene.ctws or myBundle.ctmws). Case-sensitive.
Domain Hosting Scene FileThe full URL of the server hosting your scene files (e.g., https://viewerdemo.ctech.com).
Folder Containing Scene FileThe 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 KeyA 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:

OptionDefaultDescription
Width80%Width of the embedded viewer. Accepts pixels (e.g., 640) or a percentage (e.g., 80%).
Height400pxHeight of the embedded viewer. Accepts pixels (e.g., 600) or a percentage.
Allow Full ScreenOnWhen enabled, users can expand the viewer to fill their screen.
Allow Scene InformationOnWhen 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:

<iframe loading="lazy"
    src="https://viewer.ctech.com/inline_viewer.html?apikey=CEBA68C1CC918347&model=https%3A%2F%2Fviewerdemo.ctech.com%2Fclients%2Fmyclient%2FmyScene.ctws"
    width="80%" height="400px" frameborder="0" allowfullscreen>
</iframe>

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:

ParameterRequiredDescription
apikeyYesYour 16-character API key
modelYesURL-encoded path to the scene file (domain + folder + filename). Supports both .ctws and .ctmws files.
include_infoNoShow or hide the information panel (true or false, defaults to true)