rendering Canvas in transformed parent #804
Unanswered
garretteklof
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Canvas fills 100% of the next relative or absolute parent. A parent that is neither does not really classify as a parent in css. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello - first and foremost, thanks for all the work done on this incredible library!
My question is probably more of a CSS issue, but I'm trying to figure out how to render the canvas in a 3D transformed parent element that gives the effect of it on a plane. I can't seem to get the canvas to properly take up the height / width of the parent (inspect and you'll see
<canvas>
going rogue) and if I manually override the height and width w/ CSS I lose the ability to interact in the canvas (block events). This seems to be due torotateY
transform. I tried all sort of combinations. Any best way in achieving this?Attached is a codepen -> https://codesandbox.io/s/r3f-basic-demo-forked-8544c?file=/src/styles.css
Beta Was this translation helpful? Give feedback.
All reactions