Are you able to assist me with node rotation like strikes up and down in cocos 3.5 .
are you able to ship me any references or hyperlinks or doc .
Thanks in Advance .
Okay, I’ll attempt to assist clarify a bit. It may be fairly sophisticated and if any of this already I’m sorry.
So with regards to rotations we use Quaternions and for positioning Vector3 inside a 3d house. Vec3 and Quat are the courses utilized in Cocos. Vec3 has 3 axis and Quat has 4 axis.
Vec3 has: X Y Z
Quat has: X Y Z W
So relying on axis is what you wish to improve to make it rotate. For instance:
replace(){
this.node.setRotation(new Quat(this.node.getRotation().x+1,this.node.getRotation().y,this.node.getRotation().z,this.node.getRotation().w));
}
Ought to improve the x axis rotation by 1 each replace. Making it spin within the x axis.
I haven’t examined the above however that ought to work.
Hopefully this helps.
it’s rotating however the third picture is coming completely after 2nd click on
Not too certain what you imply by “third picture is coming completely after 2nd click on”. The rotation is on replace not click on. In the event you’re saying it’s rotating too shortly then scale back +1 to one thing like +0.1 and many others
this.node.setRotation(new Quat(this.node.getRotation().x+0.1,this.node.getRotation().y,this.node.getRotation().z,this.node.getRotation().w));
if I click on the button the photographs ought to transfer up and down like spin mechanism
if you wish to get the concept you’ll be able to undergo spin mechanism in cocos in you tube .
Thanks
I’ve gave you a couple of methods to do it on this thread:
I haven’t sadly obtained the time to construct the mechanism for you although. You need to determine the right way to do every particular person half in cocos.
Thanks