How do I pass Enable3D the canvas I want it to use? #383
-
I don't want to use a dom element added to the end of my page, I want to give the renderer the object to use. When I try the same with Enable3D (probably incorrectly) I'm doing this:
This isn't going to work, since Scene3DConfig only accepts:
So I don't see how I can tell Enable3D which canvas to choose.. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I had to clone the repo and dig deeper into how Scene / Project interact, and I was able to determine that I didn't need a For posterity .. After a bunch of trial and error, in an application where you want to specifically position your 3D window inside of a web page, you just need to have a parent in the DOM to align it to: index.html: Then when you are about to realize the physics engine, pass in the parent as a configuration:
Thanks! |
Beta Was this translation helpful? Give feedback.
I had to clone the repo and dig deeper into how Scene / Project interact, and I was able to determine that I didn't need a
<canvas>
object as much as I needed to tell the Project who my daddy was (parent: ).For posterity .. After a bunch of trial and error, in an application where you want to specifically position your 3D window inside of a web page, you just need to have a parent in the DOM to align it to:
index.html:
<div id="game"></div>
Then when you are about to realize the physics engine, pass in the parent as a configuration:
Thanks!
P