Magnetic field tutorial - last step

   7462   7   1
User Avatar
Member
87 posts
Joined: 8月 2009
Offline
Hello

I've dropped out of Houdini for a version or two, and am now trying to create an effect as described in the following tutorial
http://pepefx.blogspot.com/2015/08/how-to-create-magnetic-vector-field-in.html [pepefx.blogspot.com]

However I get stuck at the last step where the author suggests randomizing the f@pole attribute to create a more “sun” like magnetic field.
I assume this is done in an attribute wrangle SOP, but I'm not sure what the syntax would be?

Thanks for any pointers
User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
Here is my interpretation of your request.

I added a switch as the author suggested and scattered points within a sphere.
Then I used an attribute wrangle to create random pole values for each point.
This connects into the existing structure described in the tutorial.

Attachments:
ap_two_pole_magnetic_field.hipnc (91.8 KB)
Screen Shot 2016-01-08 at 1.21.29 PM.png (193.5 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
87 posts
Joined: 8月 2009
Offline
Thanks, that is the right interpretation, but to formulate the question more precisely, how do you randomize the pole values?

Thanks!
User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
To quote an old Chinese chef I worked for “Use you eye”.

The random pole code is posted in the image and in the HIP file I attached.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
87 posts
Joined: 8月 2009
Offline
Hmm, I just looked twice and I don't see any attachment…
Am I missing something?

Thanks again
User Avatar
Member
87 posts
Joined: 8月 2009
Offline
Oops, sorry, for some reason that image was taking a long time to load, now I see it!

Thanks
User Avatar
Member
87 posts
Joined: 8月 2009
Offline
I have one more question…I like the way the velocity attribute get mapped to the Cd attribute via the volumetrail SOP. I'd like to modify the way this mapping happens…What is the best way to do that?

When I look at the volumetrail SOP, I don't see a velocity attribute being created, so not sure how I would go about modifying it?

Thanks!
User Avatar
Member
2625 posts
Joined: 6月 2008
Offline
Try setting your Visualize Velocity Ramp to greyscale. Then add an attribute VOP after the Volume Trail. Dive inside the VOP and add A Ramp parameter and connect Cd from the Globals to the Ramp and then back to the output. Jump up one level and you will have a standard color ramp that you can colorize as you see fit.

Attachments:
Untitled-2.jpg (35.0 KB)
Untitled-1.jpg (108.4 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
  • Quick Links