Jump to content

POPs - Glass Shatter Effect ...


djwarder

Recommended Posts

HNY guys!

I'm racking my brains over how to get this effect to work, but think it should be easy enough to achieve. I want to do a reasonably hi-res window shatter but even with 16Gb of RAM my machine can't do that using RDBs (Bullet). However, it doesn't need to have proper inter-piece collision so I wonder if I could use particles.

My idea is to shatter using voronoi, use a ForEach to add a point per centroid, pass this thru POPs and then use a Copy SOP to assign each piece back onto the corresponding simulated point. However, this never quite seems to work - either the pieces have the wrong position or rotation, or they're ok until they move & then they have weird movement. Anyone have any idea how to achieve this at all?

Cheers, Dan

Link to comment
Share on other sites

This is just for my understanding.

I tried to achieve what djwarder asked in the 4th post using primitive sop. Please refer the attached file.

I got the faulty output, orientation of each polygon in a piece is the problem I am facing. Can someone please explain to me where am I going wrong? Or is it at all possible using this method?

Thanks for your time.

:)

Shatter_poly_orient_PROBLEM.hipnc

Edited by sadhu
Link to comment
Share on other sites

Can someone help me fix the polygon orientation issue ?

If particles are not rotating then this works but not otherwise. One more thing that I noticed is if particles rotate in y axis only, it works but not if i set value in x or z axis / or both of them. I tried overriding the particle normal by point sop (0,0,1) and up vector (0,1,0) but it didn't help. (Please refer my file in the 6 th post)

Thanks.

:)

Edited by sadhu
Link to comment
Share on other sites

Thanks a lot EFX , IKARUS and VI_RUS for your replies.

I wanted to understand the orientation of polygons(source geo, pieces) wrt random axis rotation particles (template points with rotation axis values, say x =rand($PT), y = rand($PT * 6598), z = 1 -rand($PT*85421) ) All your files are very helpful for me. I am studying them.

When we use prim sop (my file in the 6 th post) to achieve this , the calculations needed to achieve the effect are happening behind the scene. I fail to understand why it works when there is rotation in Y axis only and doesn't work as soon as I add some value in other axes in rotation pop. What changes should I make in the file so that prim sop starts giving me the result. (I know, this is not the best approach but I think that if I manage to get the result , I will better understand the normal, up vector and polygon orientation relationship, just for my understanding )

Can you please help me understand what should I do to make it work or why it is not working?

@ IKARUS - I added particles to your file and made few changes (centroied multiplied by identity matrix and result added to position of points of incoming piece geometry) I manage to get them move but could not make them rotate as per center particle rotation. I refered EFX 's file and tried to make changes in your file to get the rotation but failed.

@ VI_RUS - I could not make you file work with particles(with rotation) added as pieces center.

Can you please take a look at the attached file and tell me how can I add rotation to pieces from particles with your approaches ?

It will help me to understand this issue even better.

Thanks for your time.

: )

shatter_piece_copied_on_particles.hipnc

Edited by sadhu
Link to comment
Share on other sites

...

it is possible to do even with quat (4 floats)

...

well particles use orient and rot which are both quaternions

there is no problem to represent rotation as one quaternion, so there deffinitely is an easy way to do it in your file

I can have a look in my free time

Link to comment
Share on other sites

Can someone help me fix the polygon orientation issue ?

If particles are not rotating then this works but not otherwise. One more thing that I noticed is if particles rotate in y axis only, it works but not if i set value in x or z axis / or both of them. I tried overriding the particle normal by point sop (0,0,1) and up vector (0,1,0) but it didn't help. (Please refer my file in the 6 th post)

Thanks.

:)

Even your "Correct" branch has some offsets in pieces.

It's due to difference between $CEX/Y/Z and centroid expression. So when you create template points using centroid op you and then transforming prims using $CE* you have 2 different points

And then you have problems with orientation of the primitives when rotating around orbitrary axis cause you define up vector in foreach2 and overwrite it to be 0,1,0 all the time.

I marked changed nodes in red (fixed only CORRECT branch, didn't look through other nodes)

p.s. not the best way to copy primitives on points) look what anim and vi_rus suggested.

Edited by bloomendale
Link to comment
Share on other sites

Hi Bloomendale. Thanks a lot for correcting the offset issue.

I know that this is not the best way. I am studying all the files posted in this topic especially the matrices part and trying to find out what is wrong in my approach. As mentioned before this is just for my understanding. I am still not clear whether it is due to point Normals or upvectors or combination of them with rotation is causing the orientation issue.

In your file if i set rotation pop > rotation axes value to say x = rand($PT) , y = rand($PT*8956) and z axis = 1-rand($PT*124578), I am still getting the polygon orientation problem and after few frames piece geometry is offsetting from its particle.

Link to comment
Share on other sites

To proper fit primitives you need at least N and up vector to be transformed on points.

Thanks Bloomndale. You fixed it ! :)

Its up vector that was causing this problem.

Once again thank you all for your files, great learning resources.

:)

Link to comment
Share on other sites

as a part of original question here is the most efficient way I know to animate pieces using points or particles

essentially it's just one VOP SOP

and as a part of rotation question it uses quaternion attribute rot from POPs

rather than Rotation POP I used Angular Velocity POP to generate rot since that way you always start at 0 and makes more sense since POPs are simulation environment you don't want to set exact rotation baset on frame as it's the case of Rotation POP

animate_pieces_using_particles.hip

  • Like 2
Link to comment
Share on other sites

POPs are simulation environment you don't want to set exact rotation baset on frame as it's the case of Rotation POP

I should have realized that. I completely forgot about vel pop. Thanks Anim for pointing it out.

As usual your file is very helpful.

:)

Link to comment
Share on other sites

  • 2 weeks later...

thank you for the file Anim

this resolve a lot of problem of copy stamping voronoi pieces back onto point, this method is simple and resource friendly.

I am realizing that vopsop is a very big thing in Houdini.

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...