Socket
Socket
Sign inDemoInstall

@lumiscaphe/viewer

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lumiscaphe/viewer

Lumiscaphe 3D Viewer


Version published
Weekly downloads
351
decreased by-28.66%
Maintainers
1
Weekly downloads
 
Created
Source

viewer

Lumiscaphe 3D Viewer

Installation

$ npm i @lumiscaphe/viewer

or

$ yarn add @lumiscaphe/viewer

The basics

Initialize Lumiscaphe Viewer as simply as this:

const container = document.getElementById('viewer');

const viewer = new LumiscapheViewer(container, {
  server: 'https://wr.lumiscaphe.com',
  onInteraction: () => {},
  onLoadStart: () => {},
  onLoadProgress: () => {},
  onLoadEnd: () => {},
  onLoadError: () => {},
});

LumiscapheViewer constructor accept following parameters:

  • container : div where viewer will be integrated
  • server : WebRender server url
  • onInteraction : event sent on user interaction
  • onLoadStart : event sent on load start
  • onLoadProgress : event sent on load progress
  • onLoadEnd : event sent on load end
  • onLoadError : event sent on load error

Scene

const scene = [{
  database: 'ee294840-5689-49b0-9edb-527598602df0',
  configuration: 'Bin.Blue/Cabin.Yellow/Style.Design1/Wheels.Red',
  animations: ['LeftDoor'],
}];

viewer.load(scene);

A scene is an array of products defined with:

  • database : product 3D model guid string
  • configuration : product configuration as a string of concatenated values separated by a slash
  • animations : product animations as an array of string

A single product will drive the main product. In case of two product, the first one should be the main product and the second one the decor.

View

const view = {
  mode: 'image',
  camera: 'EXTER/1',
  background: 'product',
};

viewer.setView(view);

A view can be defined in the following modes:

Image

  • mode : image
  • camera : camera path
  • background : view background mode (product, transparent, gradient)

VRCube

  • mode : vrcube
  • camera : camera path
  • background : view background mode (product, transparent, gradient)

VRObject - animation

  • mode : vrobject
  • animation : animation name
  • camera : camera path
  • frames : number of frames
  • loop : whether animation loops or not
  • background : view background mode (product, transparent, gradient)

VRObject - bookmark set

  • mode : vrobject
  • camera : camera group path
  • background : view background mode (product, transparent, gradient)

Transition

const transition = {
  fromPosition: 0,
  toPosition: 2,
  animation: {
    name: 'Porte Gauche',
    camera: '/Camera_Ext',
    duration: 1,
    reverse: false,
  },
};

viewer.load(scene, transition);

viewer.setView(view, transition);

A transition can be set when loading a scene or setting a view with:

  • fromPosition : go to specific vrobject image at the beginning - optional
  • toPosition : go to specific vrobject image at the end - optional
  • animation :
    • name: animation name
    • camera: camera path to use for animation
    • duration: animation duration in seconds
    • reverse: whether to reverse animation direction

Encoder

// Default values
const encoder = {
  format: 'jpeg',
  quality: 80,
};

viewer.setEncoder(encoder);

An encoder is defined with:

  • format : encoder format (jpeg, png)
  • quality : encoder quality (0-100 for jpeg and 0-9 for png)

Parameters

// Default values
const parameters = {
  antialiasing: false,
  superSampling: 2,
};

viewer.setParameters(parameters);

Render parameters are defined with:

  • antialiasing : whether software antialiasing is enabled or not
  • superSampling : super sampling coefficient 1-4

WebRender is always optimized for the following default values (false, 2). Change this with precaution !

FAQs

Package last updated on 19 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc