b0le
January 25th, 2008, 03:08 PM
Well, after trying to figure out how to write a script, I managed to come up with this script to load a 3d clock into the cube. It is reasonably simple, only 20 lines long.
It requires latest git version of cubedbus (as I have made some bug fixes (regarding rotation) and also added ability for it to send 'modify' messages (which it uses to update the position of the hands)
Simply extract and run "./clock.sh" (to delete the clock run "./delete.sh root.clock")
EDIT: I have added a screenshot (though I didn't have the script running at the time, so it is out of sync), and as you can see the models are very basic (but it would be very easy to load a nice looking model instead, all you need to do is replace the 3 .obj files).
Some modifications would be to make the clock spin around (just add a "string:'rotateY' double:1 string:'rotateSpeed' double:0.5" to the end of the first line to do that)
It comes with 3 simple models, one for the 'face' and 2 for the hands. These can easily be replaced with your own models (feel free to post some models if you find/make some) though the hand rotates around 0,0 and must be pointing upwards (along y axis) - though all of this could very easily be changed in the script by adding string:'translateX|Y|Z' changing the rotation settings, changing order of transformations (or even applying multiple transformations, by putting the hand underneath another object)
It requires latest git version of cubedbus (as I have made some bug fixes (regarding rotation) and also added ability for it to send 'modify' messages (which it uses to update the position of the hands)
Simply extract and run "./clock.sh" (to delete the clock run "./delete.sh root.clock")
EDIT: I have added a screenshot (though I didn't have the script running at the time, so it is out of sync), and as you can see the models are very basic (but it would be very easy to load a nice looking model instead, all you need to do is replace the 3 .obj files).
Some modifications would be to make the clock spin around (just add a "string:'rotateY' double:1 string:'rotateSpeed' double:0.5" to the end of the first line to do that)
It comes with 3 simple models, one for the 'face' and 2 for the hands. These can easily be replaced with your own models (feel free to post some models if you find/make some) though the hand rotates around 0,0 and must be pointing upwards (along y axis) - though all of this could very easily be changed in the script by adding string:'translateX|Y|Z' changing the rotation settings, changing order of transformations (or even applying multiple transformations, by putting the hand underneath another object)