Itoo Software Forum

Author Topic: Gradient Rotation between Markers  (Read 394 times)

GeraldW

  • Newbie
  • *
  • Posts: 17
Gradient Rotation between Markers
« on: January 13, 2023, 12:48:25 PM »
Hey,

I would like to build a railing which gradually roates the elements from 0 to 90 degree based on RC_Marker_ID.
Anyone can help me building this style?

Thanks and best,
Gerald

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2447
Re: Gradient Rotation between Markers
« Reply #1 on: January 16, 2023, 11:00:21 AM »
Hi Gerald,

You can calculate the rotation values from the XSectionPosition which gives the normalized position over the current section on X Spline (0.0 to 1.0)  - a section is a path between two Start, End, Corner, Evenly or Marker segments. Just please note, that you should assign some Segment (it can be even an empty Segment) to the Markers slot to affect the calculation. Once done, the following expression should do the trick:

return radToDeg(XSectionPosition*PI/2);

Please find attached the modified scene (230116_Railing_Gradient_iToo.max).

I hope that helps.

Best regards,

GeraldW

  • Newbie
  • *
  • Posts: 17
Re: Gradient Rotation between Markers
« Reply #2 on: January 16, 2023, 11:50:57 AM »
That´s perfect!
Thanks Michal