You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating the various components (most notably <Scene> and <Mesh>) are pretty cumbersome even if you just want a simple scene with a single mesh in it. There are a lot of fiddly props and boilerplate that feels very Un-React-ish.
However, IMO the basic react-three components should try to mirror three.js as close as possible which makes it easier to maintain and test the components. A possible approach is to create a set of "higher-order components" which wrap the default components and add sensible defaults or common boilerplate. Some examples:
<DefaultScene> would provide a default camera at some prescribed distance and size itself to fit into the browser window
<OrbitCamera> would rotate/pan/zoom child objects based on mouse/touch actions, similar to the code already added by 8318719
<Box> creates a box of a certain size and color
<AutoMesh> handles the loading of mesh geometry and materials and things.
This will probably go into an addons directory or something similar.
The text was updated successfully, but these errors were encountered:
Creating the various components (most notably
<Scene>
and<Mesh>
) are pretty cumbersome even if you just want a simple scene with a single mesh in it. There are a lot of fiddly props and boilerplate that feels very Un-React-ish.However, IMO the basic react-three components should try to mirror three.js as close as possible which makes it easier to maintain and test the components. A possible approach is to create a set of "higher-order components" which wrap the default components and add sensible defaults or common boilerplate. Some examples:
<DefaultScene>
would provide a default camera at some prescribed distance and size itself to fit into the browser window<OrbitCamera>
would rotate/pan/zoom child objects based on mouse/touch actions, similar to the code already added by 8318719<Box>
creates a box of a certain size and color<AutoMesh>
handles the loading of mesh geometry and materials and things.This will probably go into an
addons
directory or something similar.The text was updated successfully, but these errors were encountered: