random rotate: not so random...

   7700   4   0
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi,

I'm scattering rocks using the for-each-loop. I've made an expression for the random rotation: rand($PT)*360

I can see that the rocks have some difference in rotation but not so much…

What am I doing wrong?

-Olivier

Attachments:
randRotate_problem.jpg (171.0 KB)

User Avatar
Member
2531 posts
Joined: June 2008
Offline
At a glance, you are using CopyToPoints wrong. CopyToPoints will already loop over your points, you may not want to put it inside of a loop. What is the loop looping over? Also to rotate a copy as you have shown you would need to use the old CopyStamp node and stamp the rotation value into the transform with an expression.

The new way with CopyToPoints is to calculate the rotation and generate the @orient attribute on the right input points.
Check out this link.
http://forums.odforce.net/topic/32582-solvedrandom-orient-all-3-axis/ [forums.odforce.net]
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Hi Enivob,

I was trying to go along what's on the help page:

“Copy stamping is no longer the recommended way to create variations when copying to points. Using a For-each loop and attributes instead is more efficient, easier to set up, and easier and understand.”

http://www.sidefx.com/docs/houdini/copy/stamping [www.sidefx.com]


Here's the tutorial I followed:
http://www.sidefx.com/docs/houdini/copy/tutorial_stamping.html [www.sidefx.com]

-Olivier
User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
Simplest method giving random rotation would be adding an Attribute Randomize SOP

Attribute Name: orient
Dimensions: 4 (vector4)
User Avatar
Member
1004 posts
Joined: April 2017
Offline
Thanks!

I'll look into that node.

-Olivier
  • Quick Links