djwarder Posted January 7, 2013 Share Posted January 7, 2013 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 Quote Link to comment Share on other sites More sharing options...
anim Posted January 7, 2013 Share Posted January 7, 2013 nothing much to say untill we see your file or it would be too long, there is plenty of things that could go wrong, but otherwise it's pretty straightforward to achieve Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 7, 2013 Share Posted January 7, 2013 I hope this file helps. Shatter_soln.hipnc Quote Link to comment Share on other sites More sharing options...
djwarder Posted January 7, 2013 Author Share Posted January 7, 2013 Ah cheers Sadhu, that's what I was looking for. Only thing that would be nice is if it could work with any voronoi fracture with an inside, is this possible at all? Quote Link to comment Share on other sites More sharing options...
efx Posted January 8, 2013 Share Posted January 8, 2013 You mean like this?? You can use python instead of using foreach sop if you wanna make it faster. I hope you like it. Cheers test.hipnc 1 Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 8, 2013 Share Posted January 8, 2013 (edited) 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 January 8, 2013 by sadhu Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 11, 2013 Share Posted January 11, 2013 (edited) 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 January 11, 2013 by sadhu Quote Link to comment Share on other sites More sharing options...
ikarus Posted January 11, 2013 Share Posted January 11, 2013 This is by far the best approach I've seen for what you're looking for. Create a rotation matrix comprised of 3 vector attributes on proxy points, vectors get properly rotated in sim, reapply rotation and position to each piece afterwards. vex_proxy_pts.hip 1 Quote Link to comment Share on other sites More sharing options...
vi_rus Posted January 11, 2013 Share Posted January 11, 2013 It's possible to do even with 2 vectors. Check out my file. VOP_rot.hip Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 11, 2013 Share Posted January 11, 2013 (edited) 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 January 11, 2013 by sadhu Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 11, 2013 Share Posted January 11, 2013 It's possible to do even with 2 vectors. Check out my file. \it is possible to do even with quat (4 floats) Who's next?=) Quote Link to comment Share on other sites More sharing options...
anim Posted January 11, 2013 Share Posted January 11, 2013 ... 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 Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 11, 2013 Share Posted January 11, 2013 (edited) 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 January 11, 2013 by bloomendale Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 11, 2013 Share Posted January 11, 2013 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. Quote Link to comment Share on other sites More sharing options...
bloomendale Posted January 11, 2013 Share Posted January 11, 2013 (edited) My bad. Reload file from my previous post. I forgot about N. To proper fit primitives you need at least N and up vector to be transformed on points. And don't forget about Transform Attributes parameter in primitive SOP. DONE. 3ak_Shatter_poly_orient_PROBLEM (fixed).hipnc Edited January 11, 2013 by bloomendale 1 Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 11, 2013 Share Posted January 11, 2013 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. Quote Link to comment Share on other sites More sharing options...
anim Posted January 12, 2013 Share Posted January 12, 2013 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 2 Quote Link to comment Share on other sites More sharing options...
sadhu Posted January 13, 2013 Share Posted January 13, 2013 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. Quote Link to comment Share on other sites More sharing options...
FR3D Posted January 25, 2013 Share Posted January 25, 2013 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. Quote Link to comment Share on other sites More sharing options...
tinboy Posted September 3, 2014 Share Posted September 3, 2014 Hi everyone How can I calculate the area for each piece and copy the area value to each particle and use that to drive the weight value in pops? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.