Izzimach / react-three-legacy

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

Update to React 0.14 #24

Closed Izzimach closed 9 years ago

Izzimach commented 9 years ago

In addition to just updating the code to work with 0.14, some changes to consider:

  1. Add babel to the pipeline. Not only is React using it, but ES6 is right around the corner anyways.
  2. Remove DOM references if possible. Instead of creating a WebGL canvas, the user would create their own <canvas> element and place the Scene under it. This removes most dependence on the DOM although getting mouse events will have to be handled/abstracted away. Removing all DOM reference makes it easier to do item 3, which is:
  3. Add some hooks to render to a native OpenGL surface instead of WebGL. This would mean adding a native lib to replace three.js functionality. It should also be compatible with react-pixi
agrande commented 9 years ago

Any progress on this? Is there a way I can help?

fabslab commented 9 years ago

What about implementing a Canvas component in ReactTHREE/ReactPIXI that uses DOM canvas in default implementation but users can create and pass in their own implementations for other platforms?

fabslab commented 9 years ago

You'll have to create an abstraction over react-three, react-pixi, and whatever the react-opengl suggestion uses (needs a specific example of an OpenGL scene graph/rendering library).

Izzimach commented 9 years ago

For native OpenGL version a completely new version of threejs would be needed which maintains and renders the scene graph in native data structures. This should probably wait until React 0.14. The initial version will probably run on desktop first (via Qt or FLTK) since I haven't worked much on iOS or Android.

Izzimach commented 9 years ago

The initial upgrade to use 0.14 is at b8f8ce1faee5eca52066e345f58a63827f924a9c which works with React 0.14.0-rc1 with minimal changes. Hopefully this means an easy transition when 0.14 comes out for real.

Izzimach commented 9 years ago

Version 0.7.0 using React 0.14 is up and published. Tested it with r3test but there may be broken bits.