0.1.9 • Published 2 years ago

open-react-3d-viewer v0.1.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Open-React-3d-Viewer

A 3d viewer for your React app.

  • No react 3d library needed.
  • Simple control process.

tl;dr

  • Install by executing npm install open-react-3d-viewer or yarn add open-react-3d-viewer.
  • Import by adding import Visualaizer from 'open-react-3d-viewer/dist/Visualaizer'.
  • Use by adding <Visualaizer /> . use controlVisualaizer prop for getting new values'

Demo

Live demo is available.

Online demo

Getting started

Installation

Add Open-React-3d-Viewer to your project by executing

npm install open-react-3d-viewer

or

yarn add open-react-3d-viewer.

Usage

Here's an example of basic usage:

import React, { useState } from 'react';
import Visualaizer from 'open-react-3d-viewer/dist/Visualaizer';

function MyApp() {
 const [controlVisualaizer, setControlVisualaizer] = useState({
			rotationSpeed: 10,
		});

  return (
    <div>
      <Visualaizer
			controlVisualaizer={controlVisualaizer}
			setControlVisualaizer={setControlVisualaizer}
		/>
    </div>
  );
}

Custom styling

Custom styling added automatically when you install the package

User guide

State Object Value nameDescriptionDefault valueExample Values
enableRotationFor enable or disable rotationtruefalse
rotationSpeedits change rotation speed10-10 or 20
rotationTopLimitFor change rotation top angle view11 to 32
rotationBottomLimitFor change rotation bottom angle view21 to 32
zoomEnableFor enable or disable zoomtruefalse
zoomInLimitFor how mouch zoom in3010 to unlimited
zoomOutLimitFor how mouch zoom out91 to 10
backgroundFor background change{ value: '#0dcaf0', type: 'plainBackground' }{ value: 'red', type: 'plainBackground' }
loadingFor loading animationtruefalse
modelFor Change model''{ url: glb/gltf/fbx/obj model url, extension: glb/gltf/fbx/obj }