Kooky math/Vops question - the Rotate VOP

   18520   20   2
User Avatar
Member
153 posts
Joined: July 2005
Offline
How do you represent the line x = 1 as a vector?

It can't be:

(1,0) which is the x axis
(0,1) which is the y axis
or
(1,1)

so what the hell is it!! I don't think it can be represented at this point but I need to verify that.

;D

I am asking this because I'd like to use the rotate VOP to handle translation of the axis of rotation. Am I right in interpreting the use of the VOP as only being able to handle rotations around the (0,0,0) for the axis of the input vector and not translations of any of the axes?
I can explain more if there is interest.

Thanks Again!
User Avatar
Member
2199 posts
Joined: July 2005
Offline
Well in 3D

x = 1 is (1,0,0)


The rotate vop doesn't support translates, i assume it just works by rotating around an axis through the origin (0,0,0) which is what you'd want for rotating a vector. To rotate a point around a different center you would have to first translate the point by the inverse of the pivot position - to move the pivot to the origin - do the rotation - and then move it back.

So build a translate matrix from your pivot point, invert it and multiple the point by this matrix. Then do the rotate, then multple the result by the initial translate matrix.

I think that's right anyway….
The trick is finding just the right hammer for every screw
User Avatar
Member
153 posts
Joined: July 2005
Offline
I will try what you have put forth but I disagree with the vector statement.
In math x=1 is the line located at x=1, which reaches from -infinity in y to positive infinity in y. Essentially, translating the y axis over one unit.
(1,0,0) is the x asis in the positive direction. They are perpendicular to each other. I never noticed this slight notational problem.

In your head put a point at (1,0,0) then extend a line upward into postive y infinity. That is a vector but not relative to (0,0,0). I beleive that vector cannot be represented with a reference other than (0,0,0). You would have to translate the entire reference system, over.( Which is what moving the source point does) But in my case I didn't want to do that. I wanted to bring that translated vector into the rotate vops, but it doesn't do that. So I am stuck.

User Avatar
Member
153 posts
Joined: July 2005
Offline
I am not sure what you mean build by building a translate matrix from my pivot,
can you explain that a bit.

Oh and by the way I don't disagree that (1,0,0) is a point at x =1, but generally speaking x=1 is a lline.

There is a file in other my other question posted earlier if you'd like to look.

Thanx so much!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Oh and by the way I don't disagree that (1,0,0) is a point at x =1, but generally speaking x=1 is a lline.
You have confused me. A vector is not x = 1. That is a plain old function and I am a noob with math. A vector by it's definition is magnitude and a direction. No mention of origin or offset. Magnitude means it has a definite length. Not infinite in both +ve and -ve directions like your x = 1 function.

The part that breaks my wee brain is how to rotate a line of infinite length… Don't you have to locate those points?


A vector has a quantity for example like velocity which is completely specified by a magnitude and a direction.


If you want x = 1 in a shader, just use a very narrow pulse function to do that. Rotate the space of the index in to pulse to rotate the feature.

Other than that, do exactly what Simon said in his first response as he is correct.
There's at least one school like the old school!
User Avatar
Member
153 posts
Joined: July 2005
Offline
I am not trying to say that x = 1 is a vector, I am using x=1 the function to describe the vector I would like to have, meaning a vector pointing in the Y direction placed at the point (1,0,0). Basically, I am tring to offset the axis because when I translate my source point in my simulation, the rotational axis doesn't seem to be following it, in other words my source moves to (1,0,0) world space, but my rotational axis is still emenating from (0,0,0) world space.

Actually, I am rotating a line , taking the endpoint position of it, normalizing it and then putting that into my rotational axis of the Rotate VOP.
I also have the line translating so the rotational axis should be moving with it, but from what I can see it is still emenating from (0,0,0).
I guess I'd have to show you the file.

I'm still not sure how to translate the pivot point as Simon said.
Can either of you send me a sample?

Thanks,
User Avatar
Member
153 posts
Joined: July 2005
Offline
Yes, I have verified with both of your help that the axis in Rotate vop is not being translated. Here is my file. Now how do I get that axis moved over?

Thanks,

Attachments:
helix_position_test.hip (355.0 KB)

User Avatar
Member
153 posts
Joined: July 2005
Offline
By pivot point, do you mean the source point?


:
User Avatar
Member
153 posts
Joined: July 2005
Offline
Got a million questions here:

I am taking the position and velocity in VOPs, using the translate input of the maketransform VOP to create matrices of them both. Piping each of those into their own Rotate VOP, matrix input, and using my animated axis of roation's normalized end point as the value being piped into their roation axes, also using the same input angle, then extracting the translates of the Rotate VOP and pipe out to position and velocity.

So you are asking me to bring in the source point, use make transform to create a matrix, invert and multiply the initial source matrix by its own invert matrix?

“Then do the rotate …”

Do you mean do the rotate as I am currently doing it AND do it to the source point?

I lose you after this.


Thanks,
User Avatar
Member
153 posts
Joined: July 2005
Offline
Okay I got it.
I just subtracted the amount of translation from from the axis and the particle point to set everything back to the origin. Then rotated. Then added back the translation after the rotoation. I didn't need to convert to matrix form and was able just add and subtract vectors, before and after the rotation matrix.

Thanks,
David
User Avatar
Member
153 posts
Joined: July 2005
Offline
Sometimes I think I am talking to myself here! ;D

I am still having one problem.

The translations look great but now the rotations looked a bit tweaked.
Suspect is the way I have the velocity setup in my VOP.
I would be pleased if the Masters of the Universe could check my methodology!

Thanks,

Attached is the file.

Attachments:
helix_position_test_2.hip (357.5 KB)

User Avatar
Member
2199 posts
Joined: July 2005
Offline
I'll try and have a look later. But just to clear up the confusion x=1 is not the equation of a line, it is a point, or I suppose it could be a plane. X can only have one value if is to meet the terms in your equation, and that value is 1. Hence why I assumed you meant (1,0,0) in 3D…..
Edited by - June 9, 2006 08:35:45
The trick is finding just the right hammer for every screw
User Avatar
Member
153 posts
Joined: July 2005
Offline
Thanks, I am completely appreciative here and if you can't get to it …
understood.

User Avatar
Member
65 posts
Joined: July 2005
Offline
Simon
x=1 is not the equation of a line, it is a point, or I suppose it could be a plane.

X=1 is a point in 1D, a line in 2D and a plane in 3D.

But, aside from that …

DavidMarcus, you indicated you don't currently like the rotations of your particles. What would you like to be different about them?
User Avatar
Member
153 posts
Joined: July 2005
Offline
Thanks for the clarification …. on that x=1 business.
I guess that makes me 2 dimensional … hee, hee.

When you translate only, the beam stays in tact.
It should do that as well for the rotation only (no translate) of the axis.
So I should be getting a cone that is rotating about (0,0,0) when there is not any translation.

Instead I am getting some weird looking shapes….
Hmmm just though of something…. maybe my pivot point isn't moving or something.

I really appreciate all your guys help!

;D
Edited by - June 9, 2006 14:35:16
User Avatar
Member
153 posts
Joined: July 2005
Offline
Setting all the available VOP pivots to $XMIN,$YMIN,$ZMIN did not work.

User Avatar
Member
153 posts
Joined: July 2005
Offline
I believe I have encountered a problem in the way Houdini is calculating the VOP, its order of precedence. The initial velocity should be accounted for and then rotated around the axis of rotation, but instead it is being tacked on at some point and thusly offsetting everything.



The way I have it setup, in this simplified file and intuitively thinking, the particles should be rotating around the z axis.

Most importantly, as the initial velocity increases it should just change the radius around z and not offset it from z. What do you think?



Piping in a rotated velocity will fix this, but then the aberration will rear its ugly head again, in more complex setups, when axis is being rotated.

I would appreciated someone else's opinion here to double check my logic.

Please refer to the simplified file attached.



Attachments:
rotate_vop_not_calculating_properly.hip (246.3 KB)

User Avatar
Staff
4456 posts
Joined: July 2005
Offline
This latest file is behaving correctly. Your VOP Network will take a point and rotate it around the z axis with the origin as the pivot point. So if you remove the velocity from your points, they don't move because they all start at the origin, and rotating in any way with the origin as the pivot point won't move them. If you move your points out to (1,0,0), but still with no velocity, the points will rotate around the z axis as you expect.

In the hip file as is, the reason the points don't rotate around the origin is their velocity. On each timestep, the POP Network first calculates the new point positions based on the old positions and the velocity. Once ithas done that, it processes the POP nodes in the network. So in your network, at each timestep the particle moves a bit to the right, then that new position is rotated around the z axis with the origin as the pivot point. The path this ends up generating is approximate (though I expect not exactly) a circle, but not centered around the origin. If you do the steps one by one, following a single particle, it makes sense. Move right, then rotate around the z axis. Repeat.

Rotating the velocities in this setup will just make things more confusing. It is not obvious to me what the path would look like in that case. I suppose it would depend on how you rotated the velocities.

As a more general observation of your Vopnets, your methodology of creating a matrix from the particle position, modifying the matrix, and then extracting the translates from the modified matrix seems very odd to me. When doing vector/matrix arithmetic, I find it much easier to build a matrix that represents the transform I want to do, then multiply the vector (position) by the transform matrix. The resulting vector is the transformed position. It's roughly equivalent I guess, but I find it much easier to keep my transform matrix separate from my vectors being transformed. Just from an organizational standpoint. Plus I believe the extract xform operation is considerably slower than simply multiplying a vector by a matrix.

To your original question of how to change the pivot point for your rotations, it's quite easy. Straight rotation matrices will always rotate about the origin (that's why there's no pivot parameter on the rotate VOP). To rotate about a pivot point, first translate your point by the negative of the pivot point (move the pivot to the origin). Then rotate around the origin. Then translate by the pivot point (move the origin back to the pivot point).

I've attached a simple hip file showing the alternate method for transforming points (build the transform matrix, then multiply the position by the transform). It also shows how to rotate around an arbitrary pivot. I've removed all velocity from the particles because (as your hip file demonstrates) velocity can radically affect the motion of a particle when you're altering the position directly. If you are going to be transforming particle velocities as well as positions, remember that to transform a vector properly, you should multiply it by the inverse of the transpose of the transform matrix. Otherwise you're treating the vector (representing a direction and magnitude) like a point (representing position), and you won't like the results.

Mark

Attachments:
rotate_vop_calculating_properly.hip (250.2 KB)

User Avatar
Member
153 posts
Joined: July 2005
Offline
Thank You for your explanations.

I have been through many iterations with this idea and have hit on some of the ideas you have explained and the clarification is useful and appreciated.

This simplified file is not fully representative of what I am trying to accomplish but represents an obstacle, which I was trying to overcome, that is having to translate the source point, away from the axis of rotation. There is a lot of info here and I am not sure how best to accomplish what I want at this point.

I'll try and clarify if I can't construct something with the information you have provided here.

As for now, I have changed your setup slightly and put a paramter in the axis field instead of a constant.

One thing I noticed, and also happens in my other more complex rigs, is that the shape of the spiral changes when the rotational axis is other than (0,0,1) or any other primary axis. In this case I set the the axis to (.6,0,1) and the amplitude of the beam is larger at frame 90 (arbitrary frame), then it was when the axis is set to (0,0,1) at frame 90.
That seems odd to me. Just rotating the axis, the beam should stay the same shape. Am I incorrect on that?


Attachments:
rotate_vop_calculating_properly_change_to_axis.hip (250.8 KB)

User Avatar
Member
153 posts
Joined: July 2005
Offline
I think the problem, in my other rigs, is that I am not calclulating velocity correctly.

I am not sure of how to do the following, do I do this before I rotate, and then do nothing afterward, do I need to muliply by the transpose after the rotate?:

“If you are going to be transforming particle velocities as well as positions, remember that to transform a vector properly, you should multiply it by the inverse of the transpose of the transform matrix. Otherwise you're treating the vector (representing a direction and magnitude) like a point (representing position), and you won't like the results. ”

I would appreciate an example of this in VOP form if possible.

Thanks!
  • Quick Links