Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: JTP Vis on October 03, 2017, 11:06:12 AM

Title: Strange scale anomaly after RC3
Post by: JTP Vis on October 03, 2017, 11:06:12 AM
Hi,

Following on from the information about RC3 which says:

Quote
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!

Cheers,

Bill
Title: Re: Strange scale anomaly after RC3
Post by: JTP Vis 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:

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 :-) ).

Cheers,

Bill
Title: Re: Strange scale anomaly after RC3
Post by: iToo 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.