ITOOSOFT Forum

Author Topic: Stepped rotation  (Read 4745 times)

ritoo

  • Jr. Member
  • **
  • Posts: 89
Stepped rotation
« on: March 09, 2023, 06:52:31 am »
1. HI, I've got a Forest in path mode (@vertex) with stepped rotation effect applied. All is good but it rotates in world space. How do I make it respect the path orientation?
Should the effect code be altered somehow?
2. And, If I add the splines marked red on the second pic the stepped rotation get lost completely .
Thank you in advance
« Last Edit: March 09, 2023, 07:40:07 am by ritoo »

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3215
Re: Stepped rotation
« Reply #1 on: March 09, 2023, 09:35:09 am »
Hi,

Well, the mentioned effect is written for the Image Distribution Mode. Please find a slightly changed version of it (FEffects_AdditionalSteppedRotation.eff), which “adds” the Stepped Rotation values for the Path Distribution mode. Another option would be to use the Probability Curve, for these purposes, which lets you define the probability of each random value in the rotation range.

I hope that helps.

Best regards,

ritoo

  • Jr. Member
  • **
  • Posts: 89
Re: Stepped rotation
« Reply #2 on: March 09, 2023, 10:42:29 am »
Thanks for assisting Michal! Have you tried the new effect on the forest I provided?
I played with all settings that could influence but there's no stepping whatsoever. No luck with probability curve either.
« Last Edit: March 09, 2023, 11:03:01 am by ritoo »

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3215
Re: Stepped rotation
« Reply #3 on: March 09, 2023, 03:09:29 pm »
Hi,

Having the Transform > Rotation feature disabled, it seems to work just fine. Please find attached the modified scene (230309_step_iToo.max). I hope that helps.

Best regards,

ritoo

  • Jr. Member
  • **
  • Posts: 89
Re: Stepped rotation
« Reply #4 on: March 09, 2023, 03:48:49 pm »
Fantastic, Many thanks! Rather important thing, could it come with installation please?

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3215
Re: Stepped rotation
« Reply #5 on: March 10, 2023, 12:37:51 pm »
You're welcome. I'm glad to hear, that it helped, and wish you the best results. We’ll update it. Meanwhile, please find attached a slightly adjusted style.

Best regards,

nubo

  • Jr. Member
  • **
  • Posts: 69
Re: Stepped rotation
« Reply #6 on: January 02, 2026, 02:40:22 pm »
Hi,

What should I modify in the effect to make it respect also the surface normal?
Right now it respects the path direction but some of the rotated objects get really weird rotation depending on the angle of the surface.
The objects that don't get any rotation are aligned to the surface correctly.
I tried manipulating fpItem.surfNormal attribute but I'm bad at vector math.   ::)


Best regards,
Przemek

Michal Karmazín

  • ITOOSOFT
  • Hero Member
  • *****
  • Posts: 3215
Re: Stepped rotation
« Reply #7 on: January 05, 2026, 11:05:27 am »
Hi Przemek,

As you've pointed out, when surface normals need to be taken into account, the effect should be adjusted to consider these rotations. Please find an attached sample scene demonstrating this. Another simple alternative, without using any effect, would be to duplicate the item, rotate it as needed, and add it to the Geometry list. I hope this helps.

Best regards,

nubo

  • Jr. Member
  • **
  • Posts: 69
Re: Stepped rotation
« Reply #8 on: January 05, 2026, 12:43:01 pm »
Thanks Michal, that's brilliant!

As I feared that there's some vector math needed here it turned out it was trigonometry that I failed to figure out on my own.
I'm sure that you'll update this effect in the next release but for now I took the liberty of posting your solution here for other users.

Code to add to the original "Stepped Rotation" effect:
Code: [Select]
fpItem.rotation.x = -atan2(fpItem.surfNormal.y, fpItem.surfNormal.z);
fpItem.rotation.y = asin(fpItem.surfNormal.x);

As always, the Itoo support didn't let down.  :)
Best Regards,
Przemek