Shahzaib 3d Customizer

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  

image.thumb.png.6da0d7c7524a058041e103b157c675a3.pngth

 

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);
    };

    initClock();

 

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

image.png.b50e4d61046badfef6129abb05027349.png

 

any one can send me the demo of clock function ? 

 

Share this post


Link to post
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 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.