csp Posted October 3, 2013 Share Posted October 3, 2013 I have a flock of helicopters using particles, how can I simulate the helicopter-like orientation based on their velocity/acceleration? Either during the POP-sim or post-sim inside SOP level. So far, I am using their velocity direction as N to have them facing forward. Is there any way to rotate points in VOPs? Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 3, 2013 Share Posted October 3, 2013 I'd use the velocity as up vector and and have the velocity multiplied with acceleration plus a vector (0,1,0) as a normal. but this does not include banking... So something like this N = normalize((vector(velocity)*acceleration)+vector(0,1,0)) up = vector(velocity) Quote Link to comment Share on other sites More sharing options...
Ezz Posted October 3, 2013 Share Posted October 3, 2013 Hi. There is the rotateVOP Just a few topics - Hope it helps Erik Quote Link to comment Share on other sites More sharing options...
csp Posted October 3, 2013 Author Share Posted October 3, 2013 (edited) cheers guys for the replies, here is a test hip for anyone wants to give it a try. I will try now to implement your suggestions. test_heli.hip Edited October 3, 2013 by cparliaros Quote Link to comment Share on other sites More sharing options...
csp Posted October 3, 2013 Author Share Posted October 3, 2013 (edited) I'd use the velocity as up vector and and have the velocity multiplied with acceleration plus a vector (0,1,0) as a normal. but this does not include banking... So something like this N = normalize((vector(velocity)*acceleration)+vector(0,1,0)) up = vector(velocity) this getting me really close but I had to do the opposite, where N=v and up=normalize((v*accel)+(0,1,0)) in order to make it work. This gives me the leaning when turning left or right but not when goes up or down where suppose to keep the up vector... up, it flips and even for left and right the amount of leaning is too much. Also I have to work on the leaning forward when it goes fast. attached a hip to demonstrate the flip when it goes up. The funny thing is that if you display the up vector you can see that it works as it should but the copy object does dont follow that. test_heli_2.hip Edited October 3, 2013 by cparliaros Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 3, 2013 Share Posted October 3, 2013 Is it something like this you are looking for? The normal vector is necessary to control the pitch of the helicopter. the up controls its general direction. test_heli_2Kim.hip Quote Link to comment Share on other sites More sharing options...
csp Posted October 3, 2013 Author Share Posted October 3, 2013 (edited) kim thanks you very much, this is what I was looking for, what I missed is that you multiply the velocity with the length of accel and not its vector. I love using algorithms to make thing works!!! Thanks again. About banking, for some reason the mistake it did before gave me that effect. Edited October 3, 2013 by cparliaros Quote Link to comment Share on other sites More sharing options...
rayman Posted October 4, 2013 Share Posted October 4, 2013 Well Its vector math. Quote Link to comment Share on other sites More sharing options...
csp Posted October 4, 2013 Author Share Posted October 4, 2013 ok, I am still looking for the bank angle when it makes a turn, I found this algorithm: pivotNormal = (0,1,0) bank = normalize(velocity - cross(normalize(velocity), pivotNormal) * pivotNormal) it does not seems to work, this gives an vector pointing forward (0,0,-1) to his main direction no matter if it makes a turn and you can use it to get the angle between that and velocity using dot product, but when the turn is 90 degrees and so basically the direction have changes to (1,0,0) then bank vector flips. That makes me think that I am using the wrong algorithm. The even bigger question is, I have the acceleration forward tilting and lets say I get the banking, how do I combine them to the up vector and is there any way to also combine both N and UP vectors and convert them to one single vector with values in degrees which will represent the rotation of the instancing as this what it needs the pdc in Maya where the instancing and rendering will take place. Any idea for any of the above? Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 5, 2013 Share Posted October 5, 2013 Here's a version with Roll included. test_heli_2Kim-WithRoll.hip 1 Quote Link to comment Share on other sites More sharing options...
csp Posted October 5, 2013 Author Share Posted October 5, 2013 (edited) Here's a version with Roll included. thanks again! One question, why on the default vector (input2) you have 0,20,0 and not 0,1,0? In order to make the tilting less strong? Isn't it better to multiply with 0.- the acceleration? Also regarding to my question in my previous post how to have the same tilting movement with a single 3d vector attribute "rotation" because it has to be exported in another application which does not recognise up vector. I have attached a hip where a vop sop translate the normals to rotation but it only works partially. A couple of people looking on this but we cant figure out what's wrong there. test_heli_2Kim_sifis.hip Edited October 5, 2013 by cparliaros Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 5, 2013 Share Posted October 5, 2013 (edited) thanks again! One question, why on the default vector (input2) you have 0,20,0 and not 0,1,0? In order to make the tilting less strong? Isn't it better to multiply with 0.- the acceleration? It would make it indeed easier to read, but using a longer vector removes the need of a multiplier operation since the vector is normalized at the end. Also regarding to my question in my previous post how to have the same tilting movement with a single 3d vector attribute "rotation" because it has to be exported in another application which does not recognise up vector. I have attached a hip where a vop sop translate the normals to rotation but it only works partially. A couple of people looking on this but we cant figure out what's wrong there. Easiest is to build a matrix using the different vectors you have to calculate. Then you can extract the rotation values from it. test_heli_2Kim-RotationAttr.hip Edited October 5, 2013 by kgoossens Quote Link to comment Share on other sites More sharing options...
csp Posted October 5, 2013 Author Share Posted October 5, 2013 Easiest is to build a matrix using the different vectors you have to calculate. Then you can extract the rotation values from it. Indeed, much easier from what I had and more effective! What I had It was working as quaternion by taking the angle from dot product and the axis from the cross and you could pass that to ROT attribute in houdini and it works but the problem was on the conversion of quaternion to 3d vector. With the rotation vector you dont need the 90° rotation in X on the instance geometry. But I was wodering, if the instanced was already flip in any direction when in the vopsop you could add an offset to address this problem? Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 5, 2013 Share Posted October 5, 2013 Sure, you just have to set the proper fitting transformation axis (XYZ vectors in the matrix). Right now I created an axis that was aligned to the world (Therefore it matches the helicopter). But it is easy to rewire it to a different initial setting. Quote Link to comment Share on other sites More sharing options...
csp Posted October 5, 2013 Author Share Posted October 5, 2013 (edited) Sure, you just have to set the proper fitting transformation axis (XYZ vectors in the matrix). Right now I created an axis that was aligned to the world (Therefore it matches the helicopter). But it is easy to rewire it to a different initial setting. watching closer the animation, it seems that the roll causing "jumping", no linear movement only on the rolling, you watch throw the cam1 on the attached hip at 79 frame and onwards. I tried to round on the roll value but it didnt helped, what do you think is causing that? test_heli_2Kim-WithRoll_2.hip Edited October 5, 2013 by cparliaros Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 5, 2013 Share Posted October 5, 2013 watching closer the animation, it seems that the roll causing "jumping", no linear movement only on the rolling, you watch throw the cam1 on the attached hip at 79 frame and onwards. I tried to round on the roll value but it didnt helped, what do you think is causing that? That has to do with the sampling in the popvop of the roll vector. To remove that the easiest is to move it to chops and smooth the channels over there. Quote Link to comment Share on other sites More sharing options...
csp Posted October 5, 2013 Author Share Posted October 5, 2013 That has to do with the sampling in the popvop of the roll vector. To remove that the easiest is to move it to chops and smooth the channels over there. I have not much of experience in chops, but I tried using a resample node. The curves from roll attribute looks smoother in the Motion view but the animation wasn't improved. Then I tried to pass the roll attribute from curve to points on sop level inside the vopsop where is been used to compute the tilting, again it wasn't improved. Finally I had another idea, to increase the number of points in the curve by decreasing the length in the resample node, which smoothed the animation! Still it would be nice to spent more that on that tomorrow and try to achieve the same effect using the vel and accel as you did for the speed forward tilting. Because in this caseI have the path but in another shot where the particles will be without path, I will need another solution. Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 6, 2013 Share Posted October 6, 2013 (edited) Here's a version with chops and without using path to set its roll. test_heli_2Kim-NoPathAttr&Chops.hip Edited October 6, 2013 by kgoossens Quote Link to comment Share on other sites More sharing options...
csp Posted October 6, 2013 Author Share Posted October 6, 2013 Here's a version with chops and without using path to set its roll. I think you forgot to attach the hip file Quote Link to comment Share on other sites More sharing options...
kgoossens Posted October 6, 2013 Share Posted October 6, 2013 Updated 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.