Jump to content

Copy geo to points and vary scale in each direction


Recommended Posts

Hello, first post here.

I'm trying to do something that seems simple but I just cannot figure it out.

I'd like to take a piece of geometry and copy it to points, and randomize scale in each direction to give it some variation.  I've tried using rand() a number of different ways, in a for-each loop, but any time I apply a random change to scale in X, Y and Z each copy ends up looking identical.

It's probably dead easy but I'm stuck!

Thanks in advance for any help.

Link to comment
Share on other sites

Well I couldn't make it work in a for-loop, but I scrapped it and just used a point wrangle on the points coming in to the copytopoints with this:

v@scale = 1;
v@scale.x = rand(@elemnum);
v@scale.y = rand(@id);
v@scale.z = rand(@ptnum);

I guess the key is varying the random element between each component, rather than using the same one...

Link to comment
Share on other sites

Yep, you got it :) Although instead of using three separate attributes, you can use '@id+123', '@id+456', '@id+789' for the x, y and z random seeds (or any other values you see fit). The rand() function just uses the seed you give it to generate a value from 0 to 1.

Link to comment
Share on other sites

9 hours ago, bootshank said:

Well I couldn't make it work in a for-loop, but I scrapped it and just used a point wrangle on the points coming in to the copytopoints with this:

v@scale = 1;
v@scale.x = rand(@elemnum);
v@scale.y = rand(@id);
v@scale.z = rand(@ptnum);

I guess the key is varying the random element between each component, rather than using the same one...

For simple cases you can use an Attribute Randomize SOP.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...