Jump to content

I NEED HELP IN Clock time Function in babylon js 3d configurator

Recommended Posts

I NEED HELP IN Clock time Function in babylon js 3d configurator  



i want to make this model watch hands Movie like Real clock and real time 


any one can help me i have use this code for run that functions 



var hrHand = document.getElementById('hrHand');
var mnHand = document.getElementById('mnHand');
var mnHand = document.getElementById('secHand');

    function initClock() {

        var date = new Date();
        var hour = date.getHours() % 12; 
        var minute = date.getMinutes() ; 
        var second = date.getSeconds() ; 

        var hrDeg = 0;
        var mnDeg = 0;
        var secDeg = second * 6;

                        hrHand.transform = 'rotate(' + hrDeg + 'deg)';
                        mnHand.transform = 'rotate(' + mnDeg + 'deg)';

                        mnHand.transform = 'rotate(' + secDeg + 'deg)';

        setTimeout(initClock, 1000);



and my object Id is this i try all js code of clock not working any one Please help me out 



any one can send me the demo of clock function ? 


Link to comment
Share on other sites

On 10/14/2018 at 6:47 PM, NasimiAsl said:

check your mesh is not null( i guess )

if(mesh && mesh.rotation){

 // add code here


Hi mate there I have Put Clock function in my app but after put its working like this i have tired also center piviot point but its suck  can u help me please to get this work perfectly 

Link to comment
Share on other sites

Clock function not working Properly Please can u help me to fix this i have add the code that u share with me after added the code the hands of clock going messed can u help me out to fix this i have make to center of those all pivot point but its not working like clock its working like something bad can u please see the video i have attached above Please .. @NasimiAsl

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...