Space Viewer Initialization
Initialize the rooomSpaces viewer for virtual showrooms, interactive environments, and immersive experiences. The SpaceViewer is optimized for navigating and interacting within 3D virtual spaces.
SpaceViewer(iframe)
This constructor returns a new rooom space viewer instance bound to the specified iframe element. The SpaceViewer is specifically designed for immersive virtual environment applications.
Virtual Showroom Example:
var iframe = document.getElementById("space-viewer"); // The iframe HTML element
var viewer = new SpaceViewer(iframe);
// Now ready to create immersive virtual experiences
2
3
init(id, options)
This function initializes a viewer with the specified ID. The ID is the identifier part in a viewer URL. You can also pass an options object to this function - see available options.
viewer.init("123456789123456789", {
onSuccess: function onSuccessFn(api) {},
onError: function onErrorFn() {},
autostart: 1,
max_texture_size: 1024,
});
2
3
4
5
6
Customization
You can pass callbacks and customization options when you initialize a viewer.
viewer.init("123456789123456789", {
onSuccess: function onSuccessFn(api) {},
onError: function onErrorFn() {},
autostart: 1,
max_texture_size: 1024,
});
2
3
4
5
6
Alternatively, you can pass customization options as URL parameters, as described here.
Callbacks
onSuccess
- function(api)
Required. This callback will be invoked when the viewer has been successfully initialized. It will be passed an API object that allows you to interact with the viewer.
onError
- function()
This callback will be invoked when the viewer cannot be initialized.