react-whs icon indicating copy to clipboard operation
react-whs copied to clipboard

How to successfully import a OBJ

Open ruohanqi opened this issue 7 years ago • 0 comments

When I used Model component to render a OBJ. The OBJ loaded successfully, but wasn’t rendered. the component didn’t report error。Is there anyone could guide me how to use react-whs? Thanks a lot!

here is my way:

<App
    modules={[
        new WHS.SceneModule(),
        new WHS.DefineModule('camera', new WHS.PerspectiveCamera({
            position: {
              z: 20,
            },
        })),
        new WHS.RenderingModule({
            bgColor: 0x162129,
            renderer: {
                antialias: true,
                shadowmap: {
                    type: THREE.PCFSoftShadowMap,
                },
            },
         }, { shadow: true }),
         new WHS.OrbitControlsModule(),
    ]}
>
    <Model
        loader={new THREE.OBJLoader()}
        url={objURL}
        modules={[
            new WHS.TextureModule({
                url: textureURL,
                repeat: new THREE.Vector2(1, 1),
            }),
        ]}
        position={[0, 10, 0]}
        parser={object => object}
    />
   <PointLight  .../>
   <AmbientLight  .../>
</App>

Version:

  • [X] v0.1.9

Issue type:

  • Bug
  • Proposal/Enhancement
  • [X] Question
  • Discussion

Desktop

  • [X] Chrome

ruohanqi avatar Jul 29 '18 15:07 ruohanqi