Code Monkey home page Code Monkey logo

closet.viewer.js's Introduction

CLOSET 3D Viewer

CLOSET 3D Viewer is a JavaScript library to see the object in 3D on any web pages or applications supporting for HTTPS and JavaScript. By following the guide below, you can make your own 3D web viewer. As CLOSET has been also implemented with this library, you can refer to CLOSET(https://www.clo-set.com/Marketplace/Detail?itemid=a39e955d947647539314f85443c90e9b) as an example.

Download

Only you need is "closet.viewer.js" file under "dist" folder. If you want to customize the library, see How to build

Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CLO Viewer Test</title>
</head>
<body>
<script type='text/javascript' src='js/closet.viewer.js'></script>
<script>
    closet.viewer.init({
        element: 'detail_viewer',
        width: 620,
        height: 780
    })

    closet.viewer.loadZrestUrl('https://s3.clo3d.com/zpac/denim.zrest');
</script>
</body>
</html>

Here you need to get the URL of ZRest file. ZRest is a file format containing 3D geometry and material information only. When you upload a 3D file(ZPrj, Zpac, AVT and etc) onto CLOSET, a ZRest file is automatically generated in CLOSET server. You can get the URL of the ZRest file by using CLOSET API - api/Item/ZrestUrl/{itemId}.

Methods

closet.viewer.init([options:Object])

Initialize viewer with options.

Options

Option Type Description
element String Specifies a id for the container element.
width Number Width of viewer.
height Number Height of viewer.

closet.viewer.loadZrestUrl([zrestUrl:String])

Load the file from the server and places the 3D object on the viewer.

Browser Support

Works in IE11+, and all modern browsers.

How to build

If you want to modify the source code and make your own library, please follow the guide below.

  1. First, you need to install Node.js.

  2. Clone a copy of the git repo by running:

git clone https://github.com/clovirtualfashion/closet.viewer.js.git
  1. Enter the viewer directory:
cd closet.viewer.js
  1. Install all dependencies and run the build script:
npm install && npm run build
  1. Running develop with webpack-dev-server:
npm run develop
  1. Then, you can get closet.viewer.js in "dist" folder.

closet.viewer.js's People

Contributors

clo-tkay avatar jadensw avatar jtwan avatar dependabot[bot] avatar jeongtaewan avatar namssy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.