# Search the Community

Showing results for tags 'quaternion'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• General
• Lounge/General chat
• Education
• Jobs
• Houdini
• General Houdini Questions
• Effects
• Modeling
• Animation & Rigging
• Lighting & Rendering
• Compositing
• Games
• Tools (HDA's etc.)
• Coders Corner
• HDK : Houdini Development Kit
• Scripting
• Art and Challenges
• Finished Work
• Work in Progress
• VFX Challenge
• Effects Challenge Archive
• Systems and Other Applications
• Other 3d Packages
• Operating Systems
• Hardware
• Pipeline
• od|force
• Feedback, Suggestions, Bugs

• 0 Replies

• 0 Views

### Interests

Found 9 results

1. As I'm just starting to understand quaternions and orientation in Houdini, I'm not sure how complicated this is to achieve. I could be completely over thinking it. Ultimately I would like to create a force in dops to rotate the packed object to its current direction of motion, or it's velocity. Modifying @w seems to be the best way to do that. For a first step, I'm trying to make a setup that takes a rbd packed object and rotate it back to it's original orientation. While it technically does that, it doesn't do it logically. It flips around its axis in bizarre ways. As I understand, it's behaving erratically because it's trying to rotate around all of its axes at the same time. This is the code I'm using in a pop wrangle node: vector qToE(vector4 q_value){ float q_0 = q_value.w ; float q_1 = q_value.x ; float q_2 = q_value.y ; float q_3 = q_value.z ; vector out = {0,0,0} ; out.x = atan2(2*(q_0*q_1+q_2*q_3), (1-2*(q_1*q_1+q_2*q_2))) ; out.y = asin(2*(q_0*q_2-q_3*q_1)) ; out.z = atan2(2*(q_0*q_3+q_1*q_2), (1-2*(q_2*q_2+q_3*q_3))) ; return out ; } v@euler = qToE(@orient); @w = -v@euler*1*{1,1,1}; This is where I got the quaternion to euler function: I've attached my houdini file to this post. If anyone has any tips, I'd be very happy to hear them! Thanks! orient_rotate_v01.hip
2. Hello! I'm trying to create an @orient attribute on a simple circle (so the copies all point inwards towards the center of the circle) I laid down a polyframe & fed it's generated @N and @tangentu attributes into a quaternion VEX function but it's a no go. From what I gathered, I'm missing an "up" vector & a transform matrix & I'm not sure how to set this up with a wrangle... Orient_attribute.hipnc
3. ## inverse matrix for crowd agents orientation quaternion

I'm working on a simulation that has some crowd agents following a terrain using its normals as the up vector (for simplicity we can assume the terrain is a sphere). I've got my base simulation setup working fine, but in one case the sphere is moving really fast through the scene in world space. On certain frames where the terrain is moving extremely fast the crowd agents basically can't calculate the next frame so there positions end up being 'Nan' or undefined and they disappear. I tried running the simulation with up to 50 substeps, and that improves how many agents survive to the end of the simulation a bit, but still about half of them are still lost by the end of the sim. in order to combat this i managed to create a point vop that creates a transformation matrix from a tracked maya rivet/locator on the sphere. Then I applied the inverse matrix transformation to freeze the sphere at the origin to run the simulation. After the simulation is done, I'm able to re-apply the transformation matrix to the sphere to get it back to the correct spot. However, when I try to apply the matrix to the crowd agents, their final positions look correct, but their orientations are wrong. I believe the orientation attribute is the quaternion for all the agents rotations? Any ideas on how I would go about getting the agents to re-align correctly again after the simulation has been run? baking down the agents geometry and then applying the transformations seems to work, but this approach is really slow because of the amount of geometry it has to process, makes it quite difficult to iterate.
4. Hey all, I'm trying to rotate Object B to match Object A's local rotation with Python. I've been using objectB.parmTuple('r').set(objectA.parmTuple('r').eval()), but this seems to be very wrong ^^ There seems to be some euler shinanigans, for starters, so I was going to use a rotation matrix but I can't find some setLocalTransform equivalent, and setParmTransform is equally unhappy. Thanks in advance for helping me understand how Houdini prefers this to be done!
5. Hello guys ! I need a little help. I have a curve and I am trying to get secondary curves around it. And finally to convert it to geometry with polywire. I don't want my curves to interpenetrate or to twist. I scatter points into a circle. I give an individual attribute to each point. I copy them to the points of the curve. I tried polyframe and vex code to keep the orientation of the points along the curve. I manage to get it but now I see that my secondary curves twist at some points. I think that I should use quaternion as orient before the copy but I don't know how to use it. For the moment, I've got this in my wrangle before the copy : v@N = v@N ; vector tangentu = v@tangentu; vector up = set(0,1,0); vector side = cross(tangentu, up) ; v@up = side; v@side = side ; v@N = tangentu ; // p@orient = set(@tangentu.x, @tangentu.y , @tangentu.z, radians(90) ); At the end, I will use a polywire (and I don't want them to twist around my main curve). Do you have some ideas of how I can do this ? I join the scene to explain. epe_copyWithRotationAlongCurve.hipnc
6. Hi, I am trying to give little banking in my flying object.......so i have created a 3 by 3 matrix,gave an angle and an axis in the direction of velocity....and then used it in vex as a rotate matrix.... vector axis = normalize(@v); vector matx = cross(axis, {0,-1,0}); vector maty = cross(axis, matx); matrix3 m = set(normalize(matx),axis,normalize(maty)); float angle = fit(sin(@Time * 0.5 + fit(random(@ptnum),0,1,0,360)),-1,1,-45,45); @angle = radians(@angle); rotate (m, @angle, axis); @orient = quaternion(m); i want to know is there any way to print the value of rotate matrix?? i did the same thing in vop sop and its working but here i face some issue. what's wrong i didn't understand.
8. 