@unitywear/garment-preview
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Adding new models

1. Finding a model

2. Simplifying polygons and converting to GLTF

Use Blender to reduce polygon count and export as GLTF

  1. Hit wrench icon on model to access modifiers
  2. Add the Decimate modifer to reduce polygon account
  3. Export
    • Make sure scale is 1
    • Object is close to origin
    • Modifiers are all applied

References

  1. Export GTFs with blender
  2. Reducing polygon count in Blender

3. GLTF to JSX components

4. Adding a canvas texture

interface IModel{
skinRef: React.RefObject<HTMLCanvasElement>
}

export default function Model(props: IModel) {
  ...
  return (
    ...
      <mesh>
        <meshStandardMaterial>
            <canvasTexture attach="map" image={props.skinRef?.current}/>
        </meshStandardMaterial>
      </mesh>
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @unitywear/garment-preview

Weekly Downloads

1

Version

1.0.10

License

none

Unpacked Size

95.9 kB

Total Files

27

Last publish

Collaborators

  • bltech