I have a rod which I would like to rotate from one corner and I would also like to translate it at the same time. The issue is that I can rotate it and translate it simultaneously, but when it goes back to the initial position, the translation direction is completely wrong.
I understand this issue is caused by the fact that the local coordinate system orientation is changing. I have tried multiple solutions to overcome this problem but none of them worked.
I am putting the CoSpace here so that you can see the codes that I have tried and you can remix it. Thank you in advance.
hope I’ve unserstood correctly, i foud this solution for the first blue cuboid (change local to global and return moving to -1):
Hope this helps,
Hello Mr. Schiuma,
I appreciate your interest in my issue. Unfortunately, it is not what I have been looking for. I think I could not really explain what I wanted. What I want to do is, for example, let’s take the “blue” case in hand: You can see in the first motion that the rotation is about the upper hand of the rod and the translation is upwards. I want the rod to have the exact same rotation position when it comes down. I am adding a picture of the desired motion below:
Thank you again for your time and attention! I tried many different methods to make it work but was unable. Maybe you can overcome this challenge!
Basically you cannot change the local axis of an object.
But you can create the results you want.
Just add a parent object that acts as a rig.
Add a Sphere object and place it on your desired rotation axis.
Attach the object you want to rotate to the Sphere object. (Or add it as a child item using block coding)
You can rotate the Sphere object by coding to rotate the object it is attached to.
Here’s a sample for you.
@Jaewoo is quite right here - the Origin is the point around which an object rotates, so by using a custom origin object, you can set any point you like.
Note: the point on your custom Origin object (used to rotate around) will be at the bottom of the object, so it pays to keep the size of the object small to get closest to the point you want.
I often get students to create animals out of blocks, and walk them through animating the head via the different turn blocks, culminating in using a custom origin with this block.
I have tried the method you suggested but it does not work. The issue is the same. When I rotate and translate in one direction and come back, it does not come back to the initial position. Below you may find a link to the scene that I have tried:
Thank you again for your help!
Unfortunately, this method did not work. You may find a comment with the scene that I have tried the method below.
Thanks again for your help.
I’ve had issues with rotation and transition for local/global positions before, and it seems like there is an issue with positioning of imported objects.
There is something decidedly wrong with the positioning of the glider - it’s position is 0,0,0 but it’s clearly off the ground, meaning that it’s probably a local position (even though it’s not attached to anything).
When I print out the position of the Glider 1 at the start, middle, and end, this is what I get:
Glider pos 1: 0.0, 0.0, 0.0
Glider pos 2: 0.0, 0.0, -0.23
Glider pos 3: 0.0, 0.0, -4.9466723E-17
Doing the same with a built-in object is absolutely fine: CoSpaces Edu :: Turn & rotate test
@CoSpaces_Edu could you ask the devs to take a look and provide thoughts please?
I made another rig for Rod1
and make two rigs on same point.