pmndrs / react-zdog

⚡️🐶 React bindings for zdog
MIT License
443 stars 21 forks source link

dragRotate compatibility #7

Closed boardfish closed 5 years ago

boardfish commented 5 years ago

I've tried setting dragRotate={true] on an Illustration, but it doesn't seem to be working. Is this a known issue, if at all?

drcmda commented 5 years ago

It has to do with the other issue. i've had problems getting Zdog.Illustration to work properly. So the react-zdog base element "Illustration" is just a component that creates a render loop and a canvas. When the other issue is dealt with you can forward all these props. Though i still think the way zdog handles events is pretty weird.

boardfish commented 5 years ago

I've also just encountered an issue that's likely got a similar source. useRender can only be used inside of Illustrations, but I'd like to be able to change the rotate attribute of an Illustration on a frame-by-frame basis as you would with:

function animate() {
  illo.rotate.y += 0.08
  requestAnimationFrame(animate)
}

I'll raise this as a separate request.

drcmda commented 5 years ago

this should also be fixed, forwards props to the internal Illustration instance.