Jump to content
Sign in to follow this  
kenneth0322

How to adjust the width of a point multiple times

Recommended Posts

Hi. I am a beginner.
I understand myself that this is a stupid question, but I'm getting confused, so can someone please help me?

I have created a point using the addpoint function. I would like to change the interval of it multiple times, what should I do?
For example, I want 1~23 points to be spaced 1 meter apart, 24~86 points to be spaced 2.5 meters apart, 87~123 points to be spaced 5 meters apart, and so on. And those points are in a straight line.
If anyone can help me with this, please let me know.

Sorry if my English is bad. Thanks.

Share this post


Link to post
Share on other sites

Hi Ken,

set up a line with zero length, initialize transforms using rig doctor, and shift point positions in a rig wrangle:

int class = 0;
class += i@ptnum > 23;
class += i@ptnum > 87;

float spacing[] = array(1.0, 2.5, 5.0);
pretranslate(4@localtransform, set(0.0, 0.0, spacing[class]));

 

spacing_dots.hiplc

  • Thanks 1

Share this post


Link to post
Share on other sites
class += i@ptnum > 23;
class += i@ptnum > 87;

I like these two lines :)
I have to remember the trick
I've just converted the rig wrangle into a classic detail wrangle. May be more "classical" way.

@konstantin magnus
by the way, why do you use pretransform rather than transform (who seam to also work) ?

Classical vex way.hiplc

Edited by flcc
  • Thanks 1

Share this post


Link to post
Share on other sites

I'm sorry for the late reply.
Thank you very much for the scene file!
Thanks to you, the problem has been solved!
Thank you very much, both of you!
:D

Edited by kenneth0322

Share this post


Link to post
Share on other sites
On 1/15/2022 at 12:16 PM, flcc said:

 

@konstantin magnus
by the way, why do you use pretransform rather than transform (who seam to also work) ?

 

In this particular case, pretransform and transform are identical, because there is no other kind of transform than translate.

Share this post


Link to post
Share on other sites

Ok, then maybe this allows for testing a bit more:

int partition[] = array(12, 38);
float spacing[] = array(1.5, 2.5, 5.0);
float rotation[] = array(-3, 2, 18);

int class = 0;
foreach(int part; partition){
    class += i@ptnum > part;
}

translate(4@localtransform, set(0.0, 0.0, spacing[class]));
rotate(4@localtransform, radians(rotation[class]), {1,0,0});
i@class = class;

image.png.ad88f6eea6463dbba96d5fbbb49a2f79.png

 

spacing_roating_dots.hiplc

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×