Curves are twisting unintendedly

Discussions about SOFTIMAGEs© Interactive Creative Environment©
ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Curves are twisting unintendedly

Post by ChrB » 04 Aug 2012, 21:00

Hi clever people,

I am trying to build an effect where I rotate the points of a spiral curve using the positions and rotation of a null to add to the pointPosition and then rotate the vector. All fine, except when I try to render the curves (using curves to strands) the strands get twisted as seen here: Image

I have checked the referenceFrame for each point on the curve and they look fine:
Image

I think this has something to do with the axis flipping, but I am too challenged mathematically to figure it out. Can somebody point me in the right direction for solving this?

Thanks,

Christian
Arnold for the masses!

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Curves are twisting unintendedly

Post by Mathaeus » 04 Aug 2012, 22:32

If this is a render-time extrusion (strand shape = cube or like, stranddeform is enabled), probably you want a PointUpVector or StrandUpVector attribute, with some vector which isn't parallel to tangent of curve. Let's say, axis of spiral as PointUpVector. StrandUpVector is obviously for individual rotation of segments. Relation of these two is explained in docs, afaik.

ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Re: Curves are twisting unintendedly

Post by ChrB » 04 Aug 2012, 22:58

Thanks for your answer,

yes it is a render-time extrusion.

So lets say I take the global matrix of the spiral, converts it to SRT and converts the rotation to axis and angle, then using the axis as the pointupvector and builds an array as the strandupvector, I would expect to see the shape extruded with the axis from the spiral as the upvector rotating around the strand, but at certain points it rotates more than I would expect:

Image

which makes me wonder if there is some kind of rotation values that breaks...
Arnold for the masses!

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: Curves are twisting unintendedly

Post by Mathaeus » 04 Aug 2012, 23:20

ChrB wrote:Thanks for your answer,

yes it is a render-time extrusion.

So lets say I take the global matrix of the spiral, converts it to SRT and converts the rotation to axis and angle,
instead, you can try global matrix > matrix to SRT > rotate vector. In rotate vector, put some axis, enable visual feedback (RMB on node connection line) - so you'll see which one fits. Global transform of input curve doesn't guarantee anything.

ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Re: Curves are twisting unintendedly

Post by ChrB » 04 Aug 2012, 23:38

Mathaeus wrote:
ChrB wrote:Thanks for your answer,

yes it is a render-time extrusion.

So lets say I take the global matrix of the spiral, converts it to SRT and converts the rotation to axis and angle,
instead, you can try global matrix > matrix to SRT > rotate vector. In rotate vector, put some axis, enable visual feedback (RMB on node connection line) - so you'll see which one fits. Global transform of input curve doesn't guarantee anything.
Thanks again, I get it :) Works like a charm
Arnold for the masses!

olivier jeannel
Posts: 30
Joined: 10 Feb 2012, 11:50

Re: Curves are twisting unintendedly

Post by olivier jeannel » 06 Aug 2012, 08:03

Hello there,

I'm often struggling with that problem.
Would you mind posting a little icetree (screen capture), I'm not nut sure I understand.

Thank you,

Olivier

ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Re: Curves are twisting unintendedly

Post by ChrB » 06 Aug 2012, 11:35

Hi Oliver,

until Mathaeus chimes in with a more precise description, here is my ICE-tree:

Image

In this setup I use the curve to strands compound, so in that case you need to dig into the compound to expose the set data nodes that build the strands. It just takes the global orientation of the curve and create an array from that and applied to the strand and pointUpVector.
Arnold for the masses!

olivier jeannel
Posts: 30
Joined: 10 Feb 2012, 11:50

Re: Curves are twisting unintendedly

Post by olivier jeannel » 06 Aug 2012, 12:28

Thank you ChrB,

I never used the Curve to Strand compound, but will give it a go.

Thanks a lot.

Olivier

ChrB
Posts: 55
Joined: 10 Jun 2009, 11:26

Re: Curves are twisting unintendedly

Post by ChrB » 06 Aug 2012, 16:26

It doesn't matter if it is the strand to curves compound or create strands compound, the nodes are the same.
Arnold for the masses!