Rudinie Posted November 25, 2011 Share Posted November 25, 2011 A very common method to calculate a pointnormal from a moving object (i think) is timeshifting the point by $F-1 frame and then use a point sop to add a normal by subtracting the positions like this: $TX-$TX2, $TY-$TY2, $TZ-$TZ2 This works like a charm on moving geometry. But the moment the geometry gets to a full stop, the values of $TX and $TX2 etc are exactly the same resulting in a 0,0,0 normal. Other then using a python script i can't figure out a way to store the normal in memory for a current frame to retrieve it on the next frame. Does anyone have a smart workaround for this? Quote Link to comment Share on other sites More sharing options...
tmdag Posted November 25, 2011 Share Posted November 25, 2011 (edited) by substracting point position from previous frame you can get velocity vector but not point normal. Geometry point normal have nothing to do with movement of object. Facet with recompute point normals should help you. Edited November 25, 2011 by tmdag 2 Quote Link to comment Share on other sites More sharing options...
Rudinie Posted November 25, 2011 Author Share Posted November 25, 2011 by substracting point position from previous frame you can get velocity vector but not point normal. Geometry point normal have nothing to do with movement of object. Thanks for replying. I am actually using the velocity-vector to get a point normal that's pointing in the direction of travel. I assumed this was clear but i realize it wasn't, sorry for that. In the mean time i found a workaround, by adding the point and the normal to the center of the moving object and object merge that point in, rather than adding the point in the separate object. So i guess my question came down to: how do i extract the orientation of an object that i got merged in. Quote Link to comment Share on other sites More sharing options...
tmdag Posted November 25, 2011 Share Posted November 25, 2011 (edited) By subtracting velocities data You also won't get normal. Normals have totally -nothing- to do with movement of the object. What are you trying to do ? Edited November 25, 2011 by tmdag 2 Quote Link to comment Share on other sites More sharing options...
Rudinie Posted November 25, 2011 Author Share Posted November 25, 2011 By subtracting velocities data You also won't get normal. Normals have totally -nothing- to do with movement of the object. What are you trying to do ? Well, sorry to be stubborn but yes, i AM using the point normal to orient the object in the direction of travel. :-) Of course you are right that i'm calculating a velocity vector and i am "abusing" it as a point-normal to orient the object that i copy on to the point. I've seen this done in several tutorials, most recently Jonah Hall's tutorial in the creative development series on d-t. Quote Link to comment Share on other sites More sharing options...
symek Posted November 25, 2011 Share Posted November 25, 2011 how do i extract the orientation of an object that i got merged in. Hi Rudinie, See attachment. If you need an euler rotation, use Extract Transform VOP to get angles from rotation matrix. orient_merged.hipnc Quote Link to comment Share on other sites More sharing options...
gaurav Posted November 26, 2011 Share Posted November 26, 2011 Hi Rudinie, See attachment. If you need an euler rotation, use Extract Transform VOP to get angles from rotation matrix. Thanks SYmek, Very nice way of extracting orientation in your file. I didn't know about polyframe sop. Seems very useful. However, I fail to understand how polyframe is calculating the tangentu vector. I mean, If set to Style : First edge. It gives tangentu (vector a) towards (p2,v3) from point ( p0,v0) in the attached image. I figured at least this calculation is not based on the point numbers. I tried sorting points randomly to get the same result. My next guess was that it could be based on vertex numbers. Vector from ( vert0 -> vert1) would make sense but resulting tangentu seems from (vert0 -> vert 3). So what does "First Edge" mean in this context?, And How is tangentu calculated ? Thanks, Quote Link to comment Share on other sites More sharing options...
symek Posted November 26, 2011 Share Posted November 26, 2011 Indeed, little mysterious. To me it looks like tangentu goes with the last edge, i.e. reversed vertex order, i.e. from current to previous vertex. If you take a circle object, it's vertices are reversed-ordered to points, so you can see how tangents go in opposite. With grid though, points seem to obey ordering from alternative triangles, so this does this strange effect. With box or user-made polygon they seem to keep the pattern (current->previous vertex - with special case first ->last). Interesting part is that if PolyFrame relies on vertex ordering, how it deals with shared vertices. It seems to be taking the first polygon the point is sharing vertices with for a tangentu, then normals are averaged for all, then - if "Make Frame Orthogonal" is turned on - tangent is crossed with normal and tangentv, to make it orthogonal to those, not those make orthogonal to it. Interesting! Quote Link to comment Share on other sites More sharing options...
edward Posted November 26, 2011 Share Posted November 26, 2011 A very common method to calculate a pointnormal from a moving object (i think) is timeshifting the point by $F-1 frame and then use a point sop to add a normal by subtracting the positions like this: $TX-$TX2, $TY-$TY2, $TZ-$TZ2 This works like a charm on moving geometry. But the moment the geometry gets to a full stop, the values of $TX and $TX2 etc are exactly the same resulting in a 0,0,0 normal. You're computing velocity, so I think it's correct in that sense to have a 0,0,0 value for still (non-moving) geometry. The question is how you plan on using those values, and for what purpose. Other then using a python script i can't figure out a way to store the normal in memory for a current frame to retrieve it on the next frame. What about using a SOP Solver DOP to process the same geometry from frame to frame. Quote Link to comment Share on other sites More sharing options...
gaurav Posted November 26, 2011 Share Posted November 26, 2011 Hi SYmek, you nailed polyframe !! It works exactly how you describe it. Apart from that mysterious grid, Things are so much clear now. Thanks, -Gaurav Quote Link to comment Share on other sites More sharing options...
Rudinie Posted November 28, 2011 Author Share Posted November 28, 2011 Hi Rudinie, See attachment. If you need an euler rotation, use Extract Transform VOP to get angles from rotation matrix. Hi SYmek, thanks for the example. Like vectorblur i didn't know the polyframe sop yet. Looks like a way that can be used in a lot of different situations. Quote Link to comment Share on other sites More sharing options...
pgrochola Posted February 14, 2012 Share Posted February 14, 2012 Hi Rudinie, See attachment. If you need an euler rotation, use Extract Transform VOP to get angles from rotation matrix. great example. Thanks SYmek! 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.