react-three-renderer
react-three-renderer copied to clipboard
Warning: updating prop geometry ( [object Object] ) for LineDescriptor
Not sure if this is a minor bug or if I'm doing something wrong. I noticed another module had this issue and it was fixed (#59).
Here is my code:
render() {
var geometry = new THREE.Geometry();
geometry.vertices = this.state.lines;
return (
<React3 ref={'react3'} width={800} height={500} clearColor={0xf0f0f0} mainCamera="camera">
<scene>
...
<line geometry={geometry} material={ new THREE.LineBasicMaterial({ color: 0x0000ff })}/>
...
Thanks for the report, I will be able to take a look early Saturday :)
On Fri, Nov 18, 2016, 11:54 jugglingcats [email protected] wrote:
Not sure if this is a minor bug or if I'm doing something wrong. I noticed another module had this issue and it was fixed (#59 https://github.com/toxicFork/react-three-renderer/issues/59).
Here is my code:
render() { var geometry = new THREE.Geometry(); geometry.vertices = this.state.lines; return ( <React3 ref={'react3'} width={800} height={500} clearColor={0xf0f0f0} mainCamera="camera"> <scene> ... <line geometry={geometry} material={ new THREE.LineBasicMaterial({ color: 0x0000ff })}/>
...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/toxicFork/react-three-renderer/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0iLUfRZz6veZwTnjfpCdaEr7ucc-Evks5q_ZIEgaJpZM4K2Z8o .
@jugglingcats it looks like we do not handle the geometry
nor material
properties for line
or its parent class mesh
.
Please do this instead:
<line>
<lineBasicMaterial color={0x0000ff} />
<geometry vertices={this.state.lines}/>
</line>
I made the change you suggested and error messages are gone! Thanks.
Strange that it was drawing the line at all using the attributes...?
Yes it'd work but it gives warnings because they are not being handled in an efficient way, every time you changed it it would re-create the components