JohnK Posted February 25, 2016 Share Posted February 25, 2016 Have had a look but have never used animations so am unable to help with that part. As far as I can tell you are using the property rotation and not the method rotate but whether changing this helps or not or is even possible within animations I do not know. Sorry but I cannot help you further perhaps others can. All I can suggest is you try a playground with one cube and no animations to see what is happening. Quote Link to comment Share on other sites More sharing options...
aninja Posted February 25, 2016 Author Share Posted February 25, 2016 Hey, for one cube it's working fine as it has no dependency, as far as i think for animation var UclockAnimation = new BABYLON.Animation("myAnimation", "rotation.y", 20, BABYLON.Animation.ANIMATIONTYPE_FLOAT,BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT); it take rotation parameter so may be it's doing rotation well thanks for your suggestion Quote Link to comment Share on other sites More sharing options...
aninja Posted February 25, 2016 Author Share Posted February 25, 2016 1 hour ago, aninja said: Hi @JohnK thanks for reply I have followed exact the same strategy as you told but it clashes when i start another animation look at this http://www.babylonjs-playground.com/#1MNLNN#0 there are two buttona M Clokwise and U Clockwise same, both works fine independantly but try M->U or U->M please help me to figure out @Deltakosh please help me out with this issues Quote Link to comment Share on other sites More sharing options...
adam Posted February 25, 2016 Share Posted February 25, 2016 I'm pretty sure you are dealing with your original issue. The world rotation of a mesh will change if you parent the mesh to another mesh that is rotated. Quote Link to comment Share on other sites More sharing options...
aninja Posted February 26, 2016 Author Share Posted February 26, 2016 Hi @adam thanks for reply but in rubix cube we have to change the parent after every rotation, but if a initially assign the central cube as a parent for all the 26 cubes then the whole cube will start rotating and also i can't assign mult parent with a cube please guide me Quote Link to comment Share on other sites More sharing options...
jerome Posted February 26, 2016 Share Posted February 26, 2016 aninja, did you check the former Jaskar's work : Quote Link to comment Share on other sites More sharing options...
aninja Posted February 26, 2016 Author Share Posted February 26, 2016 yes i did but i want to make my own Quote Link to comment Share on other sites More sharing options...
adam Posted February 26, 2016 Share Posted February 26, 2016 http://www.babylonjs-playground.com/#1JLWKC#13 jerome and Temechon 2 Quote Link to comment Share on other sites More sharing options...
aninja Posted February 26, 2016 Author Share Posted February 26, 2016 Oh my god you just made the fully functional rubix Quote Link to comment Share on other sites More sharing options...
adam Posted February 26, 2016 Share Posted February 26, 2016 It won't work correctly if the rubix is not at world position (0, 0, 0). Right now I'm using getAbosolutePosition for each cube. I really need a function that I can use to get the cube position in rubix space. cube.getPositionInSpace(rubix) It also screws up if you don't let an animation finish before starting a new animation. Quote Link to comment Share on other sites More sharing options...
aninja Posted February 26, 2016 Author Share Posted February 26, 2016 I'm feel like a looser now from the couple of days i was trying to do this but each and every attempt was unsuccessful Quote Link to comment Share on other sites More sharing options...
adam Posted February 26, 2016 Share Posted February 26, 2016 It's not easy. I had to use Quaternions for rotation. The parenting / space issue can also be a difficult concept to grasp. Quote Link to comment Share on other sites More sharing options...
adam Posted February 26, 2016 Share Posted February 26, 2016 I created a getCubePosition function. So now you can rotate and position the rubik's cube. http://www.babylonjs-playground.com/#1JLWKC#16 jerome 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted February 27, 2016 Share Posted February 27, 2016 Adam you've done a really good job ! Congrats Quote Link to comment Share on other sites More sharing options...
MarianG Posted February 27, 2016 Share Posted February 27, 2016 wonderfull rubik cube. just add on_end function for animations. now it need only colors :)) Quote Link to comment Share on other sites More sharing options...
aninja Posted February 27, 2016 Author Share Posted February 27, 2016 what about this http://www.babylonjs-playground.com/#1JLWKC#18 Quote Link to comment Share on other sites More sharing options...
jerome Posted February 27, 2016 Share Posted February 27, 2016 really nice work Adam ! aninja 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.