- This topic has 20 replies, 6 voices, and was last updated 1 year, 8 months ago by uvsupekar.
-
AuthorPosts
-
2021-02-14 at 1:29 am #38493mcolinpCustomer
I created a watch which has a functioning animation setup in blender to animate a second hand, with the minute and hour hand being driven by drivers that make everything work like a real timepiece.
I was wondering if there could be a way to insert via puzzles, the current time based on the viewer’s computer/browser, in a way that would make the animation advance to that same time as it is being loaded.
2021-02-14 at 9:12 pm #38511mcolinpCustomerHere is what I have so far. I have managed to create the proper relationships using Verge3D puzzles to get the proper relationships between the hour hand, and the minute hand; in regards to the second hand animation. Still struggling to see how I could get the hands to position themselves on load using the time puzzles.
2021-02-16 at 8:45 am #38594Yuri KovelenovStaffHi,
you can possibly get the current time using the exec script puzzle
then you can translate the obtained values to rotation angles
BTW here is another Verge3D-based clock app https://cdn.soft8soft.com/AROAJSY2GOEHMOFUVPIOE:c8c1476f0e/applications/budilnik/budilnik.html
2021-02-17 at 12:44 am #38633mcolinpCustomerThat example looks great. Would there be a way I could see an example of how this javascript would be applied into the puzzles, with the rotation angles as you mentioned?
I’m pretty code illiterate, so any slight modifications that would be needed, are not things I would instinctively know to do. I can usually work it out if I see an example.
2021-02-17 at 7:18 am #38641Yuri KovelenovStaffactually I was wrong: Verge3D got this puzzle recently
https://www.soft8soft.com/docs/manual/en/puzzles/Time.html#system_date_timeYou can use its output (seconds, minutes and hours) to rotate the clock hands
https://www.soft8soft.com/docs/manual/en/puzzles/Objects.html#set_transform
2021-02-17 at 1:25 pm #38663mcolinpCustomerSo I have tried various setups with the puzzles you specified, but I am still coming up short. An additional issue, is that the rotation by default, goes counter-clockwise. I tried reversing the local axis for each ‘hand’ in Blender, but it still rotates the opposite direction from what I need. Also, while the hands do move based on the puzzles, they do not reflect the actual rotation based on the Time puzzle. (At the time I made these screenshots, it was after 8:00 am here.) Of course I am likely missing something here. Here is a picture of the latest configuration:
Attachments:
You must be logged in to view attached files.2021-02-17 at 2:02 pm #38665Yuri KovelenovStaffrotation by default, goes counter-clockwise
yes, you can use negative rotation
For hours – 12 hours make 360 degrees, so 1 hour is 30 degrees, thus you need to multiply your amount of hours by 30.
For minutes and seconds – same, but multiplier should be 360/60 = 6
2021-02-17 at 5:19 pm #38666mcolinpCustomerI get what you are saying, I’m just not understanding what puzzle configuration I can use to make the time generate, translate into those values.
2021-02-18 at 1:06 pm #38692Mikhail LuzyaninStaffHere’s an example for you.
Attachments:
You must be logged in to view attached files.Co-founder and lead graphics specialist at Soft8Soft.
2021-02-20 at 5:14 pm #38763mcolinpCustomerThank you so much for the example. I was able to replicate the puzzle setup in my file, but there is an issue with the ‘hour’ hand. In between each update, it flips 180 degrees until the next update, (every second). So when it is 11:00, it will go to 11:00, then flip around to 5:00, repeatedly. I deleted all drivers from the hands, and turned off exporting the animation from blender when exporting/updating the gltf file. I cannot pinpoint what is causing this, otherwise the puzzles did work.
Attachments:
You must be logged in to view attached files.2021-02-22 at 12:36 pm #38791mcolinpCustomerIf you want to see the file, I can send it via email, through a private file-sharing link. Please provide an email address for this purpose, unless there is a simple solution you can otherwise point me to.
Thanks again for the help.
2021-02-24 at 9:40 am #38838Mikhail LuzyaninStaffIt happens in my example too or only with your app. If it’s only in your app then you can delete all what you don’t want to share and leave only not properly working mesh or replace it with something simple like cubes and share it here in archive.
Co-founder and lead graphics specialist at Soft8Soft.
2021-02-24 at 1:12 pm #38867mcolinpCustomerHere is a stripped down version. It exhibits the same behavior; with the hour hand flipping 180 degrees, back and forth every second. (It does not happen in your example, only mine.) Perhaps its the way my objects are parented?
2021-02-24 at 2:03 pm #38871Mikhail LuzyaninStaffThanks for the example, will try to find the reason of such behavior.
Co-founder and lead graphics specialist at Soft8Soft.
2021-02-24 at 6:06 pm #38875alexlopatinCustomerYou can use my example or and improve it
Attachments:
You must be logged in to view attached files. -
AuthorPosts
- You must be logged in to reply to this topic.