Skip to content

How to use PCD Loader? #2639

Answered by bgyooPtr
bgyooPtr asked this question in Q&A
Nov 28, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

I don't remember exactly because I wrote this code a long time ago, but I solved it like this.
I hope this code helps you.

const Model = async ({
  url,
  callback,
  loaderType = LoaderType.pcd,
}: {
  url: string;
  callback?: (geometry: ThreeJSDataType) => void;
  loaderType?: LoaderType;
}) => {
  let loader;
  if (loaderType === LoaderType.pcd) {
    loader = new PCDLoader();
    const geometry = await loader.loadAsync(url);
    return geometry;
  } else {
    loader = new STLLoader();
    const material = new MeshPhysicalMaterial({
      color: 0xb2ffc8,
      // envMap: envTexture,
      metalness: 0.25,
      // roughness: 0.1,
      opacity: 1.0,
      transparent: true,
      tr…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@drcmda
Comment options

@PerseyNata
Comment options

@bgyooPtr
Comment options

Answer selected by bgyooPtr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants