Itoo Software Forum

Author Topic: Strange scale anomaly after RC3  (Read 1889 times)


  • Full Member
  • ***
  • Posts: 119
Strange scale anomaly after RC3
« on: October 03, 2017, 11:06:12 AM »

Following on from the information about RC3 which says:

Evaluation order of Fixed Size and Rotate the Transform Operator
RailClone 3 fixes some illogical behaviour present in the Transform operator for previous versions. In RailClone 3, Transform->Fixed Size is computed before applying other transformations (such as Rotate or Scale). This means you can now rotate a segment, for example by 45 degrees, and then resize it using Fixed Size with no problems. In RailClone 2 this would cause the segment to skew, which is seldom desirable.

RailClone 2 | Scaling takes place after rotation, causing unwanted skew

RailClone 3 | Scaling takes place before rotation. No skew.

Unfortunately some styles have been designed to get around this earlier limitation and now don't work correctly in RailClone 3. The fix is usually relatively easy, just swap the X and Y fixed size values for the rotated part so that the sizes for each axis are set before the segment is rotated. We're aware that this can be inconvenient and we are looking into the best way to support older styles without causing confusion for users who could then experience two different ways of fixed size being calculated.

I thought this is great, but having suffered some problems with old styles now, I am wondering if there is a knock-on effect that has broken something else, or if it's a different problem.

I have an object that is rotated in an RC object, and previously I was controlling the scale of it in the Y axis by putting a Numeric Parameter, set to percentage, wired into the Y fixed scale transform on an object. This used to just scale it in Y, but now, when it is rotated, scaling it in Y causes it to rotate as well? How do I now scale it in Y?

Generally, the update is a great thing, but some of the old styles are a bit of a pain to make work again!




  • Full Member
  • ***
  • Posts: 119
Re: Strange scale anomaly after RC3
« Reply #1 on: October 03, 2017, 03:42:53 PM »
I thought I should update this, as I have been looking into it a bit more.

There are two things I have observed:
  • Scaling depends on where you do the scale in the path from object to generator: What I mean is, if you scale the object directly, you are working in object coordinates, so scaling a rotated object (rotated by a transform operator) scales the object before rotation. If you apply a rotation to an object, then apply a scale, also within the object, the rotation is added first, then the scale... strange results ensue! However, if you add a transform operator, that works on the RC object's coordinate system, so if the object has already been rotated, the scale will not be aligned to the object, but to the generator. Not very helpful, but perhaps how it is supposed to work?
  • Scaling depends on where/how your object's alignment is set up. This may sound obvious, but if you have the object's alignment set to automatic, apply a rotation to the object, then apply a scale (directly to the object) it will move the object around, as the scale changes the shape and size of the object and therefore alters where it's automatic alignment point is. Again, this may sound obvious, but it matters when it comes to applying scale.

These may just classed as observations of interest, but for me they perhaps don't perform the way I expected. They certainly seem to perform differently than before (although I can't substantiate that :-) ).




  • Administrator
  • Hero Member
  • *****
  • Posts: 3843
    • iToo Software
Re: Strange scale anomaly after RC3
« Reply #2 on: October 05, 2017, 10:11:04 AM »
Hi, yes i know the behaviour of transformations may be tricky. I'll try to explain how it works:

- When you set Translation/Rotation/Scale (let's name it R/T/S) in the Segment's properties, RailClone computes the resulting mesh according to these transformations, and store it. You cannot change the order these transformations are applied (first Rotation, next Scale and finally Translation).
- Instead, Transform nodes doesn't modify the mesh, but computes an acummulated transformation (a Matrix). Within a same Transform node, R/T/S are applied in the same order than segment.
- You can change the order that R/T/S is appied, joining several Transform nodes. For example, to be sure than Scale is applied before Rotation, use a Transform-Scale node, and next a Transform-Rotate node.
- Once that all nodes are evaluated, RailClone uses the mesh resulting of the Segment node (already transformed by their R/T/S parameters), and applies the accumulated Matrix of the Transform nodes.
- "Fixed Size" uses its own transformation. In RailClone 3 we changed the order of this R/T/S as you quoted (because a reported bug), but not for the other transformations.

Thinking it now, we would have changed everything from Rotation->Scale to Scale->Rotation, which is more logical to avoid the "skew" issue. But any change affects styles created with RC2, so we try to minimize them.
Also, ideally we should remove all transformations in the Segment node, and use only Transform nodes. But as always, we must keep it by compatibility with previous versions.
Carlos Quintero
iToo Software