"Random" controlled rotation for floor tiles

   2465   6   2
User Avatar
Member
10 posts
Joined: March 2015
Offline
Hello people!

I am working on this scene where my pavement has little bricks… i am trying to get like a random rotation for each brick. But I also want to be able to control it.

How should I approach this?

Thank you in advance!

- Manan

Attachments:
Nodes.png (34.1 KB)
Bricks.png (154.9 KB)

User Avatar
Member
7737 posts
Joined: Sept. 2011
Offline
Use point attributes on the template points to control the transform applied to each copy:

http://www.sidefx.com/docs/houdini/copy/instanceattrs.html [www.sidefx.com]
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hi;

Use “Copy Stamp” SOP. Then add a variable and enter “rand(@ptnum)” as it's value. Now you can use it as a value for your transform.
Here I attached a sample scene:

Attachments:
RandomRot.hip (70.7 KB)
01.PNG (126.0 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
10 posts
Joined: March 2015
Offline
Hey Masoud,

This worked perfectly! Thank you for the help!

- Manan
User Avatar
Member
1736 posts
Joined: May 2006
Offline
Try and avoid using copy stamping, performance will slow when you get big scenes.

For this problem you can use @N and @up to define how the tiles will be rotated by the copy-to-point sop.

Attachments:
tiles_rand_90_deg_rotate.hip (167.6 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: March 2015
Offline
Yeah i have a big scene right now and copy stamping does slow the scene down. How would you approach it then?
User Avatar
Member
897 posts
Joined: July 2018
Offline
Use ‘copy to points’ inside a for each loop that iterates over the points. For optimization then put the whole thing inside a ‘compiled block’, this will thread the copying.
B.Henriksson, DICE
  • Quick Links