firtoz / react-three-renderer

Render into a three.js canvas using React.
https://toxicfork.github.com/react-three-renderer-example/
MIT License
1.49k stars 155 forks source link

Pass geometry and material as props label:question #158

Closed yyynnn closed 7 years ago

yyynnn commented 7 years ago

Hallo!

I want to generate multiple meshes via map or something similar. But the structure seem a but chunky -
<mesh position={0,0,0} > <boxGeometry width={2} height={0.02} depth={0.001} /> <meshBasicMaterial color={0xffffff} /> </mesh>

Could it be done using props, to pass common geometry/material like this - <mesh position={0,0,0} meshBasicMaterial={"some material"}></mesh>?

yyynnn commented 7 years ago

Stupid me. got it going rather simple.