RotationSpeedAs for other axes

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
ptis
Posts: 28
Joined: Wednesday 16 May, 2012 - 10:18

RotationSpeedAs for other axes

Post by ptis »

Hello,

RotationSpeedAs is a good way to rotate an atom good looking around the z-axis. But how can I cylic rotate around other axes?

My two approches are very nasty:
1.) Create events every 0.05s to increment an internal attribute and use it with RotateCoords on 3D-Draw.
2.) Use RotationSpeedAs but calc the rotation back (with RotateCoords) and rotate around an other axis (also with Rotatecoords).

Do you have any other ideas how to do that nice?

Thanks
BartC
Posts: 47
Joined: Monday 05 November, 2012 - 17:05

Re: RotationSpeedAs for other axes

Post by BartC »

Hello ptis,

I am sorry to inform you about this, but there is indeed no property to set the rotatingspeed around another axis. The way I would solve this problem is like this:

Code: Select all

Do(
  PushCoords,
  RotateCoords(Time * 25, 1, 0, 0), {"Time * 25" is just an example, but shows a way to make it time dependent}

  {***START 3D Draw Code***}
  
  {Closed Carton Box}
  DrawModel3D(Model3D(1, c), -0.5 * xSize, -0.5 * ySize, -0.5 * zSize, xSize, ySize, zSize),

  {***END 3D Draw Code***}

  PopCoords
)
This draws a closed carton box the size of the atom with the centerpoint exactly in the middle of the atom.

Regards,

Bart
ptis
Posts: 28
Joined: Wednesday 16 May, 2012 - 10:18

Re: RotationSpeedAs for other axes

Post by ptis »

Hello BartC,

using Time is a very good idea. With that I've solved my problem.

Thanks!
Post Reply