Jump to content

newbie Animation GUI interfacing


Recommended Posts

Hi guys
I been working on a small project where I am rotation the mesh along its y axis.   
I am using  the following to "animate" the mesh. 

scene.registerBeforeRender(function () {
           physicalbase.rotation.y += 0.01;

Now I like to add in GUI functionality that can stop, speed or change the direction.
In the code below I am trying to stop the rotation but it doesnt work. I even tried changing the direction but that too doesnt work.
I will some advice help in this regards to better understand animation in BabylonJs properly and then learn how to interact with it (chaning values etc ) with the GUI

var advancedTexture = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("UI");

        var button1 = BABYLON.GUI.Button.CreateSimpleButton("but1", "Stop");
        button1.width = "150px"
        button1.height = "40px";
        button1.color = "white";
        button1.cornerRadius = 20;
        button1.background = "green";
        button1.onPointerUpObservable.add(function() {
                  physicalbase.rotation.y = 0.00;


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.

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.


  • Recently Browsing   0 members

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