Code Monkey home page Code Monkey logo

react-three-renderer's Introduction

react-three-renderer

PSA:

This project is pretty much frozen and the react-three-renderer-fiber project has been moving at a glacial rate. If you'd like to contribute to the React + Three bridge ecosystems, please take a look at how you can help with the more active https://github.com/drcmda/react-three-fiber project instead.

Back to regular readme

Render into a three.js canvas using React.

Would you like to know more? See the wiki or go straight to the API documentation.

Live examples.

Join the chat at https://gitter.im/toxicFork/react-three-renderer Build Status

npm

Current State

This is still an experimental and work in progress project, use at your own risk!

Currently supported react version: 15.5.3 ( things break fast when you fly this close to the sun )

This project is being maintained and developed relatively slowly.

Currently we're working on restoring compatibility with React 16 - Fiber edition!

See work in progress within https://github.com/toxicFork/react-three-renderer-fiber.

Expected ETA: Unknown.

Installation

npm install --save [email protected] [email protected] [email protected]
npm install --save react-three-renderer

Usage

The default export of the module is a react component. When mounted, any children of it will be placed into the three.js environment.

Here's a simple example that implements the getting started scene for three.js.

import React from 'react';
import React3 from 'react-three-renderer';
import * as THREE from 'three';
import ReactDOM from 'react-dom';

class Simple extends React.Component {
  constructor(props, context) {
    super(props, context);

    // construct the position vector here, because if we use 'new' within render,
    // React will think that things have changed when they have not.
    this.cameraPosition = new THREE.Vector3(0, 0, 5);

    this.state = {
      cubeRotation: new THREE.Euler(),
    };

    this._onAnimate = () => {
      // we will get this callback every frame

      // pretend cubeRotation is immutable.
      // this helps with updates and pure rendering.
      // React will be sure that the rotation has now updated.
      this.setState({
        cubeRotation: new THREE.Euler(
          this.state.cubeRotation.x + 0.1,
          this.state.cubeRotation.y + 0.1,
          0
        ),
      });
    };
  }

  render() {
    const width = window.innerWidth; // canvas width
    const height = window.innerHeight; // canvas height

    return (<React3
      mainCamera="camera" // this points to the perspectiveCamera which has the name set to "camera" below
      width={width}
      height={height}

      onAnimate={this._onAnimate}
    >
      <scene>
        <perspectiveCamera
          name="camera"
          fov={75}
          aspect={width / height}
          near={0.1}
          far={1000}

          position={this.cameraPosition}
        />
        <mesh
          rotation={this.state.cubeRotation}
        >
          <boxGeometry
            width={1}
            height={1}
            depth={1}
          />
          <meshBasicMaterial
            color={0x00ff00}
          />
        </mesh>
      </scene>
    </React3>);
  }
}

ReactDOM.render(<Simple/>, document.body);

To go further, follow the white rabbit.

Building

Fork and clone this repository, then do a npm install.

npm run compile produces es5 compatible code in the 'lib' directory.

You can use npm link or local npm install if you would like to play with your fork.

Testing

# make sure that you have run compile first
npm run compile
npm test

Currently it runs tests on Chrome, but other browser support can be added if necessary. More information on testing will be added here.

Influences

I have been heavily inspired by react-three by Izzimach.

After finding out about React 0.14, I have decided to see how someone would approach writing their own custom renderer.

This is the outcome of that curiosity.

Implementation Details

I have looked very deeply into how react-dom works. It is internally referred as ReactMount.

Starting from ReactMount#render, I duplicated the functionality, function by function, line by line.

Wherever the DOM was mentioned, I replaced them with generic equivalents.

I tried to point to existing functions as long as they were not corrupted by the DOM.

Then I wrote my own internal components, these are things like <span/>, <div/>, <table/>. Except, now they are <scene/>, <object3D/>, <mesh/>.

This way, you don't need to import a gazillion different modules.

Another benefit is that it allows me to make things super fast and not depend on composite components at all!

In effect, a <scene/> has the same effort, and similar effects as creating a <div/>.

TODO

  • More Documentation
  • More Testing
  • More examples
  • More Performance optimizations
  • Implement rest of three.js library ( See #2 )
  • Make it generic and allow the world to create their own custom react renderers!
    • It's not that hard, trust me ;)

react-three-renderer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-three-renderer's Issues

License needed

Could the license for this repo please be added? Did not see a license file or anything stated at the top of files. Would love to use and contribute, looking for some clarity.

Add textureLoader.crossOrigin

Access WebGLRenderer

Hi there!

I am trying to implement the Stereo Effect, but as an argument it takes the renderer.
Is there any way I can pass the Three.WebGLRenderer used to the StereoEffect function?

Thanks so much!
โ€” Maxi

[ArrowHelper] bug updating prop 'origin'

Just a reminder for the bug in the Arrow Helper.

'origin' prop throws a warning on each frame: "_warning.js:44 Warning: updating prop origin ( [object Object] ) for ArrowHelperDescripto_r"

I would like to help you but cannot undertand where I should fix this bug :D

Values vs references for math constructs.

I really like the way you dealt with materials as component, working with values instead of references.

I wish there could be an easy way to have THREE.Vector3 and other math classes dealt with as values, without having to either create a new one at each render (doesn't look good performance-wise) or save a reference as class member (as done in the example).

I suppose you already thought of this question. Any plan to deal with this?

OrbitControls

I'm trying to implement an equivalent of OrbitControls, but so far I don't see a way to do it that is well integrated with React. Any thoughts given to this yet?
Do you see this as part of react-three-renderer or per-application custom code in components?

Kudos for the hard work on this lib! This looks very promising!

importers

What is the correct way to handle loading THREE.ColladaLoader created objects with this work flow?
Is porting loaders like this to your (awesome) library in the roadmap?

debugging: forgetting to put resourceId in side <resources>

I just spent a while debugging why my app was crashing,

THREE.Object3D.add: object not an instance of THREE.Object3D. Tโ€ฆE.Shape {curves: Array[1], autoClose: false, actions: Array[2], holes: Array[0], userData: Objectโ€ฆ}

Even though I was copying the examples. It turned out to be that my <shape resourceId="" /> wasn't in a <resources> tag. Is there any way to give a nice error message if this is the case? if not this tickent can be closed

Populate all material properties

  • precision
  • supportsVertexTextures
  • vertexColors
  • flatShading
  • skinning
  • useVertexTexture
  • morphTargets
  • morphNormals
  • doubleSided
  • flipSided
  • shadowMapEnabled
  • pointLightShadows
  • sizeAttenuation
  • logarithmicDepthBuffer
  • alphaTest
  • useFog
  • fog
  • fogExp
  • more?

Should work similar to material.slot attribute:

  • map ( default )
  • envMap ( e.g. slot={'envMap'} )
  • envMap
  • lightMap
  • aoMap
  • emissiveMap
  • bumpMap
  • normalMap
  • displacementMap
  • specularMap
  • roughnessMap
  • metalnessMap
  • alphaMap

See #34 (comment)

Also will need to filter them out of rawShaderMaterial when implemented.

input events

Hi,

Do you have any plans to integrate inputs(e.g. mouse collision events) with this, or any examples if you already can?

Also, have you considered opening a room on https://gitter.im/ or similar, where more conversational questions might go instead of cluttering up to the issues board?

Getting "Warning: Failed propType..." for position and rotation

I've implemented the basic example of the rotation cube from the frontpage, and on the first call to render I get these errors as warnings in the developer console:

Warning: Failed propType: Invalid prop `position` of type `<<anonymous>>`
supplied to `perspectiveCamera`, expected instance of `Vector3`.
Check the render method of `ThreeDView`.

Warning: Failed propType: Invalid prop `rotation` of type `<<anonymous>>`
supplied to `mesh`, expected instance of `Euler`.
Check the render method of `ThreeDView`.

I've verified (using this.cameraPosition instanceof THREE.Vector3 and similar for cubeRotation) that they are of the correct types. Any ideas on why it happens and/or workarounds?

Except for the errors on the first call to render, everything seems to work just fine (green cube spinning like mad on a black background).

Add a center prop to geometry?

By default, text geometry isn't centered. So wherever you place the text, it will start leftmost aligned at that position.

The Three.js examples get around this by using geoemtry.center(). This might be a nice prop to add to geometry, which bases the center point on the bounding box of the geometry.

Add contribution and test guides

  • contribution guide
    • notes about eslint and git hooks
    • how to build or use locally
    • commit messages ( not to be enforced! )
  • testing guide
    • how to run tests
    • how to write new tests

How to animate child components?

Hello,

Let's say we create some React components that will be included in the React3 scene.

Is the only way to animate them is from the _onAnimate function we have on the React3?

For now we are trying to use the _onAnimate this way (I only put the relevant parts):

_onAnimate() {
  this.setState({
    frameNumber: this.state.frameNumber + 1
  });
}

render() {
  return (
    <React3 onAnimate={this._onAnimate}>
      <scene>
        <perspectiveCamera />
        <MyChildComponent frameNumber={this.state.frameNumber} />
      </scene>
    </React3>
  );
}

Like this the MyChildComponent.componentWillUpdate() will be triggered everytime _onAnimate is called. Then we can handle the animation of MyChildComponent internally.

Is it a good pattern, or your lib provides something that can achieve the same goal? Or maybe something smarter?

Best regards, and thanks for the alpha props!

Is there a danger in declaring a <geometry> resource outside of a <resource> tag?

I'm trying to track down a performance issue. I'm making about 40 individual <textGeometry /> objects, but in a standalone file not wrapped in a <resources> tag. I put them in my app like:

            <resources>
                { otherResources }
                { lettersArray }
            </resources>

Simply adding the array of <textGeometry />s (lettersArray in this case ) drops my framerate from 60 to 10. I tried to reproduce this in a standalone example but there was no FPS drop when including the same amount of geometry objects directly in a resource tag. I'm not sure what else to look at yet. Is it ok to declare a <textGeometry /> etc component outside of a render function and outside of a <resources> tag?

warning on loading textures, using minFilter, magFilter

I am getting several warnings using scene like this. Texture is png image.

[.CommandBufferContext]RENDER WARNING: there is no texture bound to the unit 0
three.js:27674 THREE.WebGLRenderer: image is not power of two (432x305). Resized to 512x256 <img src=โ€‹"/โ€‹img/โ€‹views/โ€‹main/โ€‹UP-735/โ€‹1/โ€‹1?PVI-816">โ€‹
three.js:28591 THREE.WebGLRenderer: WEBGL_compressed_texture_pvrtc extension not supported.
three.js:28591 THREE.WebGLRenderer: WEBGL_compressed_texture_etc1 extension not supported.
three.js:27400 WebGL: INVALID_ENUM: texParameter: invalid parameter
three.js:27401 WebGL: INVALID_ENUM: texParameter: invalid parameter
            <React3
                mainCamera='camera'
                width={canvasWidth}
                height={canvasHeight}
            >
                <scene>
                    <perspectiveCamera
                        name="camera"
                        fov={35}
                        aspect={canvasWidth / canvasHeight}
                        near={0.1}
                        far={5000}

                        position={new THREE.Vector3(0, 0, 750)}
                    />
                    <object3D>
                        <mesh>
                            <meshBasicMaterial color={0xff0000} side={THREE.FrontSide}>
                                    <texture
                                        url={imageUrl}
                                    />
                            </meshBasicMaterial>
                            <planeBufferGeometry width={page.width} height={page.height} />
                        </mesh>
                    </object3D>
                </scene>
            </React3>

Wondering why, because when I used Three.js directly, it did not get any warnings.

new t.TextureLoader().load( imageUrl, (texture) => {
  texture.minFilter = texture.magFilter = t.LinearFilter;
  var material = new t.MeshBasicMaterial( { color: 0xffffff, map: texture, side:  t.FrontSide } );
  mesh.material = material;

Lets elaborate on warnings bit more:

three.js:27674 THREE.WebGLRenderer: image is not power of two (432x305). Resized to 512x256 <img src=โ€‹"/โ€‹img/โ€‹views/โ€‹main/โ€‹UP-735/โ€‹1/โ€‹1?PVI-816">โ€‹

Was supposed to be solved by texture.minFilter = texture.magFilter = t.LinearFilter;, but did not manage to achieve that in react-three-rendered. I tried using refs in componentDidUpdate as well as using onLoad callback.

[.CommandBufferContext]RENDER WARNING: there is no texture bound to the unit 0

This one is maybe related to mrdoob/three.js#8666, but I am not getting this message with same THREE.js scene.

And don't know why I am getting

three.js:28591 THREE.WebGLRenderer: WEBGL_compressed_texture_pvrtc extension not supported.
three.js:28591 THREE.WebGLRenderer: WEBGL_compressed_texture_etc1 extension not supported.
three.js:27400 WebGL: INVALID_ENUM: texParameter: invalid parameter
three.js:27401 WebGL: INVALID_ENUM: texParameter: invalid parameter

Btw really love the abstraction you have achieved, just trying to decide if its too young to be used for serious project at the point..

Multiple <scenes />?

Based on this StackOverflow question there's a strategy to render multiple scenes with the same renderer:

renderer.clear();
renderer.render( scene, camera );
renderer.clearDepth();
renderer.render( scene2, camera );

Is this an abstraction that would worthwhile to explore in this project?

Summary of differences between this and react-three?

The question was brought up here Izzimach/react-three-legacy#78 about differences between this project and react-three.

I haven't looked at this code enough to make an informed summary. I would also like to add something in react-three's README saying "if you need XXX, you should use react-three-renderer instead"

Can you comment on the differences and why a person would choose one or other?

Thanks and cool to see this project!

Implement missing internal components

  • Objects
    • Meshes
      • Bone
      • LensFlare
      • LineSegments
      • LOD
      • MorphAnimMesh
      • SkinnedMesh
      • Skeleton
      • Sprite
    • Lights
      • HemisphereLight
      • Light
    • Helpers
      • BoundingBoxHelper
      • BoxHelper
      • DirectionalLightHelper
      • EdgesHelper
      • FaceNormalsHelper
      • GridHelper
      • HemisphereLightHelper
      • PointLightHelper
      • SpotLightHelper
      • VertexNormalsHelper
      • WireframeHelper
  • Materials
    • Material
    • MeshFaceMaterial
    • RawShaderMaterial
    • SpriteCanvasMaterial
    • SpriteMaterial
  • Textures
    • CubeTexture
    • CompressedTexture
    • DataTexture
  • Geometries
    • CubeGeometry
    • DodecahedronGeometry
    • PlaneGeometry
    • PolyhedronGeometry
    • ShapeGeometry
    • TextGeometry
    • TubeGeometry
  • Shapes
    • Curve
    • CurvePath
    • Gyroscope
    • Path

What are the rules for <resources /> ?

Can you clarify what the rules for the <resources /> object is? I'm not sure when I can access a resources from a different part of my component tree, etc. Some specific questions are below.

  1. In individual component, can I reference a resourceId declared a parent component?
  2. Can I use a resource not defined in a parent component, but defined in a sibling component? As in, are resource names considered global to the render tree?
  3. Can I define multiple <resouce> tags in the same component?
  4. What happens if, in any place, I duplicate a resource / resourceId between components? Will the user of the resource look up the render tree until it finds one, or are they global and the "last" one wins?
  5. To what degree does render order matter for resources? If I referenceId a resource in a sibling component, the sibling might not have been created yet. Will this fail, or does it all get batched together at render time and sorted before render?
  6. What happens if I modify runtime properties of a resource at runtime? For example, I want to change the opacity of a material. Is this allowed / safe / efficient?

Foreign prop onMouseDown found in [mesh/react3]

Hi,

First, thanks for your great job, this lib is really cool !

I'm trying to do some stuff with it but i have a little issue when i try to give a onMouseDown event handler to mesh or react3 components like you did in your examples.

handleClick(event) {
    event.preventDefault();

    this.context.executeAction(changeColorAction, {});
}

render() {
    let window = this.context.getStore(ApplicationStore).getWindow(),
        height = window ? window.innerHeight : 500,
        width = window ? window.innerWidth : 500;

    return (
        <div>
            <React3 mainCamera="camera" width={width} height={height} antialias={true}
                onAnimate={this.handleAnimate} clearColor={0xffffff}>
                <scene>
                    <perspectiveCamera name="camera" fov={75} aspect={width/height}
                        near={0.1} far={1000} position={this.props.cameraPosition} />
                    <mesh rotation={this.props.cubeRotation} ref="mesh" onMouseDown={this.handleClick}>
                        <boxGeometry width={1} height={1} depth={1} />
                        <meshBasicMaterial color={this.props.color} wireframe />
                    </mesh>
                </scene>
            </React3>
        </div>
    );
}

I have a foreign prop onMouseDown found in mesh error when i do this. Am I doing something wrong ?
(I just want to change color when i click on cube, this is working perfectly when I assign event handler to parent div)

Thanks

Handle nested <resource> hierarchies?

Coming out of a discussion on IRC, it's expensive to delete and re-create any resources in the <resource> tag, like <textGeometry />. One solution here is to only have one top level <resouce> tag as a child of your top level <React3 /> , and to organize resource files something like:

components/
 | Castle.js
 | House.js
resources/
 | CastleResources.js
 | HouseResources.js

However, the file CastleResources.js will likely need to export multiple resources. But there's no current grouping mechanism that would work here. As in, CastleResources.js could look like:

export default <resources>
    <textGeometry ... />
    <meshPhongMaterial ... />
</resources>

However you couldn't use this in your top level container, because you'd have to do something like:

import CastleResources from '../resources/CastleResources';
...
reneder() {
    return <React3>
        <resources>
            {CastleResources}
        </resources>
    </React3>;
}

Now you'd be nesting a <resources> tag inside a <resources> tag which @toxicFork mentioned probably isn't supported by this library. Two potential solutions: Either add some sort of grouping tag that resources can legally be nested inside, or allow for and handle normalizing of nested <resource> tags

externaly loaded model - how use a apply THREE.BufferGeometry from the loaded model

I use externaly loaded models via the THREE.OBJLoader. From the loader I get the the object THREE.Group with several THREE.Mesh objects. Each THREE.Mesh object has a geometry:THREE.BufferGeometry property with this attributes

THREE.Mesh : {
   ...
   geometry:THREE.BufferGeometry : {
      attributes:Object : {
         normal:THREE.BufferAttribute : {
            array:Float32Array,
            ...
         },
         position:THREE.BufferAttribute : {
            array:Float32Array,
            ...
         },
         uv:THREE.BufferAttribute : {
            array:Float32Array,
            ...
         },
         ...
      },
      ...
   }, 
   ...
}

How to handle it in react-three-renderer? How can I make a mesh react element from this? I dont know how to use the THREE.BufferGeometry.

Shader material doesnt allow to enable extensions

I'm trying to port https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_wireframe.html / http://threejs.org/examples/#webgl_materials_wireframe to React renderer, and it seems that the shaderMaterial does accept source code for vertex and fragment shaders properly, but then doesnt allow to provide any equivalent of material.extensions.derivatives = true; (https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_wireframe.html#L92) and it fails in runtime, complaining about extensions not being enabled.

(getting started example): Material "disappears" after ~10 seconds

Not sure whether this is relevant to three or react-three-renderer though this issue is particularly boggling to me.

When running the getting started example the material "disappears" after a few seconds. Small changes to the scene affect how long it takes until the change:

  • default ~5 seconds
  • swap meshBasicMaterial for meshPhongMaterial ~8 seconds
  • add second cube ~6 seconds
  • swap boxGeometry for sphereGeometry ~10 seconds

demo

Code

// using redux instead of this.setState
// is equivalent - error still occurs when using this.setState
const Scene = connect(
  state => ({cubeRotation: new THREE.Euler(..._.range(3).map(() => state.meta.age * 0.01))})
)(
class Scene extends React.Component {
  constructor(props, context) {
    super(props, context)

    this.cameraPosition = new THREE.Vector3(0, 0, 5)
    this.firstCubePosition = new THREE.Vector3(0, 0, 0)
    this.secondCubePosition = new THREE.Vector3(2, 0, 2)
  }

  render() {
    const width = window.innerWidth
    const height = window.innerHeight

    const box = i => (
      <mesh
        position={this[i ? 'secondCubePosition' : 'firstCubePosition']}
        rotation={this.props.cubeRotation}
      >
        <boxGeometry
          dynamic={false}
          width={1}
          height={1}
          depth={1}
        />
        <meshPhongMaterial
          color={0x00ff00}
        />
      </mesh>
    )

    return (
      <React3
        mainCamera="camera"
        width={width}
        height={height}
        onAnimate={() => store.dispatch('TICK')}
      >
        <scene>
          <perspectiveCamera
            name="camera"
            fov={75}
            aspect={width / height}
            near={0.1}
            far={1000}
            position={this.cameraPosition}
          />
          <pointLight
            color={0xffffff}
            position={this.cameraPosition}
          />
          <ambientLight
            color={0x111111}
            position={this.cameraPosition}
          />
          {box(0)}
          {box(1)}
        </scene>
      </React3>
    )
  }
})

There's nothing (except the visual change) to indicate a problem occurred.

This resource was not in this map?

My application is crashing with the error:

This resource was not in this map?

On this line.

I don't have a standalone test case, but I'm switching between two <React3> top level components and both top level components have the same <MyObjects /> component as a child, which holds its own resources. Strangely, I can only reproduce the bug if I scale one of my objects down. I don't think this is directly causing the issue but maybe exposing something that is.

Lighting missing position and rotation

I've noticed the directionalLight component doesn't utilize the position prop as expected. It doesn't look like position or rotation gets used in the descriptor base or the actual component.

Should the position and rotation be set like this.refs.myLight.position.set(0, 1, 0) or should I just build the capability into my fork?

If the first way is ideal, a quick wiki update would solve this.

texture offsets?

Hello,

Thanks for this lib! It is pleasant to use it so far.

I would like to recreate this technique : texture animation with your lib. But I think we cannot manipulte the texture offset from your lib, am I right? Or do I miss the point?

Best regards,

Xavier

Doesn't build with latest babel

./react-three-renderer (three) $ gulp babel
[14:18:05] Requiring external module babel-core/register
./react-three-renderer/node_modules/babel-core/lib/transformation/file/logger.js:41
    throw new Constructor(this._buildMessage(msg));
    ^

ReferenceError: [BABEL] ./react-three-renderer/gulpfile.babel.js: Unknown option: base.stage

Looks related: babel/babelify#129

Populate wiki

  • Make all links work
  • Add detailed info to all pages
  • Make it pretty too, why not

Support for imported geometry?

I'm glancing around the source but not sure how to approach this - is there a way to use imported (obj, etc) raw geometry in this library yet?

Is it possible to implement to React Native?

I didn't use it yet, but ultimately I want my three.js module to be used on React Native?
I saw that you made it for the purpose of React Native usage.
I'm just wondering if it is already established or developing status.
Thanks.

shouldUpdate for Animation frame

So I am looking at Chrome Devtools, in the Timeline tab for my app, and I am noticing some react3 re-renders triggered by Animation Frame that, I believe, represent wasted executions of the React virtual dom diffing, resulting in no actual changes to the threejs objects:

image
(The first with longer duration I am sure is doing the job, updating them, but the following three I feel like are just wasting time... A similar pattern repeats.)

So I would like to know if there could be an use for canceling an animation frame conditionally, within the onAnimate function, maybe by exposing the requestAnimationFrame return value to it, or even by exposing the requestAnimationFrame call itself.

In a way that could effectively work as an shouldComponentUpdate parallel for three.js objects, if I am not missing something... What do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.