Skip to content

How to successfully import a OBJ #15

@ruohanqi

Description

@ruohanqi

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:

  • v0.1.9

Issue type:

  • Bug
  • Proposal/Enhancement
  • Question
  • Discussion

Desktop

  • Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions