Jump to content

adding babylon canvas to existing webpage


swat0284
 Share

Recommended Posts

Hi guys!

 

Maybe like this, swat0284?   http://urbanproductions.com/wingy/babylon/hit2501_fun/fun.htm

 

Look at the page source.

 

Line 9 - Use Adobe Muse or any text editor... to add a canvas element.  Keep its id="renderCanvas" for now.

 

Lines 20-27 - CSS Style for the canvas element.  In that demo, I am using absolute positioning.  Notice there is also a width and height setting.

 

And lastly, you need to use Muse or a text editor... to add THREE script elements.

 

a.  <script src="http://www.babylonjs.com/hand.minified-1.2.js"></script>
b.  <script src="http://www.babylonjs.com/babylon.js"></script>

c.  THE BIG ONE, the scene-drawing <script> element... as seen in the source.

 

This is one way to 'embed' a BabylonJS scene into a standard webpage.  You might not be able to add these things from within Adobe Muse.  Maybe you can ONLY place the <canvas> element (with id='renderCanvas') and add its CSS style (size and placement location)... using Muse.

 

Maybe the three script sections will need to be added with a text editor... NOT using Muse.  But I think Muse lets you add any script elements you wish... including our important three.  :)  (I have never used an HTML editor... I do it by hand.)

 

I hope this is what you were asking about.  If not, ignore me.  :)  Be well.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...