Izzimach / react-three-legacy

React bindings to create and control a 3D scene using three.js
Other
1.52k stars 128 forks source link

How do I load an external model in react-three #104

Open aiumasou opened 7 years ago

aiumasou commented 7 years ago

I want to load external models such as obj/mtl , is there any way?In react-three ' module, there are object3D, mesh etc., how to use them to load file in obj format?

Izzimach commented 7 years ago

You still haave to load an OBJ file using threejs as show here, and then extract the geometry/material. Then pass that mesh/material into a <Mesh> node.

It's not ideal, but splicing threejs nodes into a react-three scene graph would just be a big mess IMHO.

aiumasou commented 7 years ago

thanks,I did what you said . now the problem is that no mesh show in screen. The mesh's really loaded, but i can't see it. What could be the cause?

Izzimach commented 7 years ago

I'm not sure, take a look at this old example and see if you are loading models in a similar manner.