Create a Vector from a diffent a position between 2 objects

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
User avatar
matevil
Posts: 38
Joined: 23 Mar 2023, 18:49
Location: Italy
Contact:

Create a Vector from a diffent a position between 2 objects

Post by matevil » 19 Jan 2024, 15:01

Hi There!

I have a question on ICE and Vector.

I'll try to create a Vector from the difference between the position of one vector/geometry with another to drive the direction of my particles.

If I do it on the grid works, but if I try to use it inside the ICE Tree Simulation with particles doesn't work...

Image

Image


I try to do the same I did here with scripting in VEX (Houdini)




Thanks for your help
Matteo

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Create a Vector from a diffent a position between 2 objects

Post by FXDude » 19 Jan 2024, 17:44

Hi, first I added a "Switch Context" node ( required for getting stuff from other objects )

but what I think made it work was getting the point positions of the grid nearest to the particle

Image

Then you can use it to set point velocity,
or you can also use the vector to set initial direction
( also set the direction dropdown in the Emit compound PPG to "Use initial direction")

Is that what you were looking for ?

best,

User avatar
matevil
Posts: 38
Joined: 23 Mar 2023, 18:49
Location: Italy
Contact:

Re: Create a Vector from a diffent a position between 2 objects

Post by matevil » 21 Jan 2024, 11:16

FXDude wrote: 19 Jan 2024, 17:44 Hi, first I added a "Switch Context" node ( required for getting stuff from other objects )

but what I think made it work was getting the point positions of the grid nearest to the particle

Image

Then you can use it to set point velocity,
or you can also use the vector to set initial direction
( also set the direction dropdown in the Emit compound PPG to "Use initial direction")

Is that what you were looking for ?

best,
first, thanks, works, but I don't understand why is working differently for the geometry.
I tried also to apply a "negate" operator, but not did do what I wanted, maybe I should use "additional" and not subtract in this case?
But yes, it seems strange on the geometry I have one result, and on the particles another... I should investigate more.

Image

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: Create a Vector from a diffent a position between 2 objects

Post by FXDude » 24 Jan 2024, 02:22

Hi,

I wasn't sure if the shown vectors or Ice trees were from the mesh or the PointCloud,
and were these visualized vectors in the default "vector trails" mode ?

Also, first I thought you wanted to set the direction and perhaps velocity of particles, and maybe it was ?

Image
( the closer is the sphere to the grid, the slower is the velocity of emitted particles )





Otherwise, about negating vectors, switching subtraction order is the same as negating after,
and in the following I used whichever order that matched your Houdini clip visually
Image

I also used the "Set Normal" compound from EM-topololizer to set the "UserNormals" attribute,
( overrides native normals for non-subD-ed meshes )

So both the grid and the asteroid get their normal orientation from the closest point on the animated sphere
and then the cone particles get the resulting "userNormals" attribute from the "asteroid" to set their orientations.

I used normals, because that's what was shown in your presentation,
( if it was important, and to show that it could be done )
but we could also have have set an arbitrary vector attribute , and get that instead of the "UserNormals".

PointCloud Tree
Image

"Adteroid" tree
bumpy sphere with same tree in the Sim as in the Modeling Stack, otherwise UserNormals would not update in time
Image

And here's the scene if you want,
https://www.dropbox.com/scl/fi/k4vrryci ... 2wyjz&dl=1

and let me know how that fits !

Cheers,

User avatar
matevil
Posts: 38
Joined: 23 Mar 2023, 18:49
Location: Italy
Contact:

Re: Create a Vector from a diffent a position between 2 objects

Post by matevil » 25 Jan 2024, 11:54

Thanks a LOT!

I check it soon
Matteo

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests