1.0.5 • Published 5 years ago

useloadpcd v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

UseLoadPCD

npm dependency Status devDependency Status peerDependency Status

Installation

useLoadPCD requires atleast React and React-DOM v.16.8.0 (with Hooks).

If you are using npm:

npm install useloadpcd --save

or Yarn:

yarn add useloadpcd

Usage

The path given to useLoadPCD is the path relative to the public directory.

import React from 'react';
import useLoadPCD from 'useloadpcd';

const App = () => {
    const [pcdRef, status] = useLoadPCD('./simple.pcd');

    return <div ref={pcdRef} style={{ width: 800, height: 800 }} />;
};

export default App;

The second argument given to useLoadPCD has the following structure:

{
    backgroundColor: '#000000',
    camera: {
        aspect: window.innerWidth / window.innerHeight,
        far: 2000,
        fov: 50,
        near: 0.01,
        position: {
            x: 0.4,
            z: 4
        }
    },
    controls: {
        dynamicDampingFactor: 0.3,
        maxDistance: 100,
        minDistance: 2,
        noPan: false,
        noRotate: false,
        noZoom: false,
        panSpeed: 0.25,
        rotateSpeed: 2.0,
        staticMoving: true,
        zoomSpeed: 0.7
    },
    particalColor: '#ffffff',
    particalSize: 0.1,
    windowSize: {
        height: window.innerHeight,
        width: window.innerWidth
    }
};
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago