useloadpcd
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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{
        aspectwindow.innerWidth / window.innerHeight,
        far2000,
        fov50,
        near0.01,
        position{
            x0.4,
            z4
        }
    },
    controls{
        dynamicDampingFactor0.3,
        maxDistance100,
        minDistance2,
        noPanfalse,
        noRotatefalse,
        noZoomfalse,
        panSpeed0.25,
        rotateSpeed2.0,
        staticMovingtrue,
        zoomSpeed0.7
    },
    particalColor'#ffffff',
    particalSize0.1,
    windowSize{
        heightwindow.innerHeight,
        widthwindow.innerWidth
    }
};

Package Sidebar

Install

npm i useloadpcd

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

85.1 kB

Total Files

28

Last publish

Collaborators

  • dillonparfitt