Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Andrew Ray
@andrewray_twitter
i'm assigning this.refs.child.refs.mesh.material =
does that conflict with r3r?
Firtina Ozbalikci
@toxicFork
Argh, r3r being too possessive
Andrew Ray
@andrewray_twitter
I could make the mesh entirely in didMount
Firtina Ozbalikci
@toxicFork
yeah that may need to be necessary :(
Andrew Ray
@andrewray_twitter
multi-material.gif
multi material worked :)
Firtina Ozbalikci
@toxicFork
:clap:
i love the dynamic parts of the scene, lively!
so did you create the mesh entirely?
Andrew Ray
@andrewray_twitter
yeah =\
Firtina Ozbalikci
@toxicFork
not too bad!
if it works, that's good!
Andrew Ray
@andrewray_twitter
i've also started doing this, doing updates entirely in shouldUpdate and blocking render https://gist.github.com/AndrewRayCode/06a05b8a533d4b41d425ec86fbffa66f
Firtina Ozbalikci
@toxicFork
is this for perf purposes
or because multi mats are not supported?
Andrew Ray
@andrewray_twitter
for perf
Firtina Ozbalikci
@toxicFork
hmm!
Andrew Ray
@andrewray_twitter
it seems like one call to React.createElement is a lot of fn calls under the hood, maybe 10-20 before it even gets to the next shouldComponentUpdate
Firtina Ozbalikci
@toxicFork
yeah... :/
Andrew Ray
@andrewray_twitter
huge stacks every time nested react elements are rendered, and that's my app's main bottlneck
Firtina Ozbalikci
@toxicFork
i'm probably going to write a "compile react to non-react" project soon
Andrew Ray
@andrewray_twitter
reducing the number of times the code gets to createElement is a hack i'm trying to preempt that
interesting
Firtina Ozbalikci
@toxicFork
like, it'd extract components to non-react objects and do the updates directly
LOTS of magic
need to still wrap state and handle nesting etc, gonna be... fun.
Andrew Ray
@andrewray_twitter
in my case, 99% of my scene updates are using the same jsx structure, I just need to update props. setting up the whole scene graph in react is great, but then it's not needed until something is added or removed
Firtina Ozbalikci
@toxicFork
yeah :)
I'm thinking somehow to couple state and render more directly, and then from that coupling extract a render graph out and skip createElement entirely
super hard to describe, but may be worth it
long story short: "react is great for development but can be improved a lot for production"
(also need to sell the idea to facebook :D)
Andrew Ray
@andrewray_twitter
haha
Firtina Ozbalikci
@toxicFork
i have to use windows WPF for one project, and.. the xaml stuff is "quite close to react" but I'm missing the dynamic parts :p
sadly XAML is more like angularjs than react :violin:
on that note, going to sleep... take care :)
Andrew Ray
@andrewray_twitter
:wave:
Jason Miller
@imjasonmiller_twitter
test!
ArmandDu
@ArmandDu
Hello,
I've started a project in Three.js and as I'm a bit familiar with React, I started to use react-three-renderer at the same time :)
I find it really nice, thank you @toxicFork ! Unfortunately, since I'm quite new to ThreeJS (and WebGL) I have a lot of questions. Is Gitter a good place to start or is there another community where I should ask for help?
Thank you!
Jason Miller
@imjasonmiller_twitter

@ArmandDu for react-three-renderer I guess this is the best place to be :-)

There also is Stackoverflow and three.js also has its own places where you can find help. From their main page:

Nathan Bierema
@Methuselah96
Most people get a response on here fairly quickly if you have questions.
ArmandDu
@ArmandDu
Hey ! Thanks @imjasonmiller_twitter & @Methuselah96 :)

If I may, I have a first question. I set up a Meteor application with React for prototyping. I'm trying to reproduce this example: https://threejs.org/examples/?q=colla#webgl_loader_collada

I loaded the Collada and added to a group using <group ref={(ref) => ref.add(this.props.model} {...transformProps} />. (simplified)

The textures and .dae are in a ~/public/models folder. But I only get a black model

Jason Miller
@imjasonmiller_twitter
@ArmandDu does the model load without react-three-renderer? I'd go from there. If you have the ref to the object as an escape hatch, you should be able to do anything that is possible in three.js
Or perhaps something changed between versions, not sure which version of three.js you're running
ArmandDu
@ArmandDu
"react-three-renderer": "^3.2.3",
"three": "^0.86.0",

In one of my component, I'm loading the .dae with "ColladaLoader.js" that I downloaded from here: https://github.com/mrdoob/three.js/tree/master/examples/js/loaders
Then inside the loader.load's callback, I extracted the scene from the result (result.scene) and give it to my Model Component.

I'm actually testing from what I saw on the repository's issues page. If you have a better solution I'll love to hear it @imjasonmiller_twitter !

ArmandDu
@ArmandDu
Ok, so now I've got it figured for the example. But it doesn't work with my custom collada. I think I need to check my export settings
ArmandDu
@ArmandDu
So, apparently it works with UV Mapping as long as I bundle the .dae and the images together. But still open for a better way to do it :)
Thanks Jason for your help!
Jason Miller
@imjasonmiller_twitter
Haha, awesome. Nice to hear you fixed it @ArmandDu