Jump to content


Is there some Variance op?


  • Please log in to reply
8 replies to this topic

#1 bloomendale

bloomendale

    Initiate

  • Members
  • PipPip
  • 197 posts
  • Joined: 26-December 11
  • Name:- -

Posted 29 May 2012 - 03:10 PM

Hi.
I'm trying to understand POPs after Thinking particles and pflow) And what i hope to find in Houdini is some Value Variance op, especially for vectors.
Let's say i want to set velocity of the particles to [0,1,0] with a bit of random deviation of the direction in radians or degrees, where 180 degrees will mean hemisphere distribution.
But as far as i cant find built-in solution i use VOP POP, where i mix  cross(normalize(initial_vec), normalize (random_vec)) and initial_vec with mix factor from 0 to 1 and then multiply by length (initial_vec).
But Mix VOP is using linear interpolation and to make it accurate i have to add a bit more math.

Is there more simple solution (possibly built-in)?

Thanks in advance.

#2 Macha

Macha

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,654 posts
  • Joined: 23-July 08
  • Location:The Small Big P
  • Name:Marc ♥

Posted 29 May 2012 - 04:34 PM

What I've done before in this situation is to rotate the vector so that it points along one of the base axes. Then randomly rotate it, and rotate it back with the same amount you used to get it axis aligned.
My Vimeo

LinkedIn

improve side effects - use haskell


#3 bloomendale

bloomendale

    Initiate

  • Members
  • PipPip
  • 197 posts
  • Joined: 26-December 11
  • Name:- -

Posted 29 May 2012 - 05:38 PM

View PostMacha, on 29 May 2012 - 04:34 PM, said:

What I've done before in this situation is to rotate the vector so that it points along one of the base axes. Then randomly rotate it, and rotate it back with the same amount you used to get it axis aligned.

Ended up with this:
Posted Image

simple demo attached.

Attached Files


Edited by bloomendale, 29 May 2012 - 05:39 PM.


#4 vectorblur

vectorblur

    Illusionist

  • Members
  • PipPipPip
  • 255 posts
  • Joined: 05-November 10
  • Location:India
  • Name:Gaurav Mathur

Posted 29 May 2012 - 11:05 PM

View Postbloomendale, on 29 May 2012 - 03:10 PM, said:


Is there more simple solution (possibly built-in)?


May be mountain sop, also there are various noising vops one could use.


EDIT : if it is only initial velocity you want to vary, there is variance parameter in source pop under attributes.

Attached Thumbnails

  • rand.jpg

Edited by vectorblur, 30 May 2012 - 02:54 AM.

Eh *munch munch* what sop, doc?

#5 bloomendale

bloomendale

    Initiate

  • Members
  • PipPip
  • 197 posts
  • Joined: 26-December 11
  • Name:- -

Posted 30 May 2012 - 01:31 PM

View Postvectorblur, on 29 May 2012 - 11:05 PM, said:

May be mountain sop, also there are various noising vops one could use.


EDIT : if it is only initial velocity you want to vary, there is variance parameter in source pop under attributes.


Thanks. I used velocity only as example, i know there is variance parameter in Source POP and i'm surprised there is no such one in many other nodes
Mountain is using noise, but i'm aiming to do (actually did - a couple posts ago)) is make variance node where i could define vector (let it be velocity) == [0,1,0] and variance == 90, apply it only to newborn particles and get rising reversed cone of particles with 90 deegrees angle in its peak:
Posted Image

Oh, and one more question. I discovered that almost every POP operates on the whole bunch of particles. i cannot activate it per particle. And if i want to apply force only on birth i need to group newborns and operate on this group? So POP nodes are performed mostly through groups, not attribs of the particle (and attribs used to group).
Am i right?

Thanks one more time.

Edited by bloomendale, 30 May 2012 - 01:34 PM.


#6 vectorblur

vectorblur

    Illusionist

  • Members
  • PipPipPip
  • 255 posts
  • Joined: 05-November 10
  • Location:India
  • Name:Gaurav Mathur

Posted 30 May 2012 - 09:34 PM

View Postbloomendale, on 30 May 2012 - 01:31 PM, said:

(actually did - a couple posts ago)) is make variance node where i could define vector (let it be velocity) == [0,1,0] and variance == 90, apply it only to newborn particles and get rising reversed cone of particles with 90 deegrees angle in its peak:
Posted Image
That's Cool.

Quote

Oh, and one more question. I discovered that almost every POP operates on the whole bunch of particles. i cannot activate it per particle. And if i want to apply force only on birth i need to group newborns and operate on this group?
Am i right?

AFAIK, Right, one feature of the group pop which was not obvious to me initially, was that one can get particles to group from any where in the simulation, They don't have to be always part of incoming stream.

Quote

So POP nodes are performed mostly through groups, not attribs of the particle (and attribs used to group).
For applying operations on per particle basis based on attribute ,there are local variables to use and i am sure you already know it.

Cheers!!
Eh *munch munch* what sop, doc?

#7 jkunz07

jkunz07

    Initiate

  • Members
  • PipPip
  • 136 posts
  • Joined: 22-June 11
  • Location:Los Angeles, CA
  • Name:John Kunz

Posted 05 June 2012 - 11:32 AM

I've been looking into doing this with the polar to cartesian vop with good results, I've attached a video below showing it.
The bars on the bottom and top are the Phi and Theta ranges for the current frame.

https://vimeo.com/43457162
MrKunz.com
Blog | Demo Reel | Resume

#8 bloomendale

bloomendale

    Initiate

  • Members
  • PipPip
  • 197 posts
  • Joined: 26-December 11
  • Name:- -

Posted 05 June 2012 - 01:36 PM

View Postjkunz07, on 05 June 2012 - 11:32 AM, said:

I've been looking into doing this with the polar to cartesian vop with good results, I've attached a video below showing it.
The bars on the bottom and top are the Phi and Theta ranges for the current frame.

https://vimeo.com/43457162

Thanks, this will definitely work. will test it.

#9 jkunz07

jkunz07

    Initiate

  • Members
  • PipPip
  • 136 posts
  • Joined: 22-June 11
  • Location:Los Angeles, CA
  • Name:John Kunz

Posted 06 June 2012 - 03:09 AM

View Postbloomendale, on 05 June 2012 - 01:36 PM, said:

Thanks, this will definitely work. will test it.

Attached Files


MrKunz.com
Blog | Demo Reel | Resume




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users