How to code an object rotate about its own axis?

How to code an object rotate about its own axis?
The rotational axis by default is outside the object. Can the axis be shifted?

Hi @ha_sir.
Please use the turn around origin block.
turn%20around%20origin

Origin (0,0,0) local shifts the rotation axis to the object center

Thanks for your reply.
I have tried this one but cannot produces the desired effect.
In the screenshot, I want the star to revolve about its own central axis, but does not work.21%20AM

Here is the setting of the turn function.
54%20AM

Here is what actually happens. The star revolve about an axis outside the itself. Can the rotational axis be set and aligned with the centre of the star? I have tried various values of x, y, z of origin, but still cannot figure out a way to do so.

Hello, could you please share with us your scene?

Thanks, here it is:

Hello Ha_sir,

thank you for sharing your scene. We found some wrong behaviour of “turn” block and we will fix it as soon as possible.

You have a professional team!

I’m also interested in this question. I could only choose either turn the object clockwise or counter-clockwise. Did I do something wrong?

Hi @mikhailo @Nikolay ,

Still no clue for this issue ? I am facing the same problem.

https://edu.cospaces.io/UJA-UBQ

Thank you.

Hi @tajajtsidi

This is a fundamental issue with the placement of the origin in Items: the Origin is not in the center of the object - it is in the center of the local X & Y, but at the bottom of the object for Z.

This is a problem which the dev team have been notified about - you can see my test examples at CoSpaces Edu :: Test - XYZ Rotation direction

The workaround for this is to use another object as your origin, place it at the center of your Item, hide it, and use the Position of Item CoBlock as the Origin coordinates in the advanced turn block.

Hope that helps!

Geoff @ TechLeap

1 Like

Thank you @techleapnz

I have found some of these weird interpretations. It is a hard stuff to workaround.
Could you please see this example where I tried your workaround solution, it seems giving the same result.
https://edu.cospaces.io/VAM-YKH

Thank you so much.

You did everything right, just had to position the cuboid closer to center. I moved it there and the girl turns on the chair:

1 Like

For this particular example, you can use the basic turn block, as it rotates around the Z axis by default; and as Nikolay said, what you’ve coded here works perfectly (as coded). If you expected a different result, let us know.

Geoff @ TechLeap