Get Actual World Coordinates of a Location

   2697   5   1
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Hello,

Working on a project and have been trying how to figure out a simpler expression for a channel reference.

In the example attachment I have two digital assets that each create a shape from 4 pathcvs and path node.

They each have their independent motions with the exception of the second asset that is to the upper right of the first asset shape, that shares the 2 pathcv positions always, no matter what other movements go on or are defined.

To do this each shared pathcv point gets a channel reference to the first pathcv with an expression similar to :

ch("../../Tawny/tx") + ch("../../Tawny/pathcv_Pt2_positive/tx") - ch("../tx")


I was wondering though if it's possible to get the actual ‘world’ coordinates of the pathcv position being referenced and use that value in the other pathcvs' transforms translate paramter?

I've tried working out something in a python shell using ‘hou.points.geometry’ with no luck.

There were 3 ways I tried this with the pathcv.

I tried using both the pathcv node and the last one of the chain inside it ( points node ) and they both return the positions of the Path node that the pathcv is connected too ( or so it appears, I just may be mistaken as to interpreting the results ).

The third way was trying to access it through the .bgeo node ( which is flagged as the output of the pathcv node ) but get error messages saying there is no geometry information for that node.

Although I suspect if I could do this I would also have to find a way to ‘force’ those ‘world coordinates’ in the second pathcvs transform paramter to act as world coordinates as well. Since any value entered in the regular way will be interpreted as an offset from the paths current position ( the path node associated with the pathcv node ).

Probably my code might not end up being so simple and I don't really need an alternative…what I am doing works fine.

But it would be a good excercise to learn how to work with Houdini in a different way out of curiosity.

Any insights are appreciated.

Attachments:
test (03).mp4 (2.9 MB)

User Avatar
Member
280 posts
Joined:
Offline
Hi this is in VOP
Best regards
Patar

Attachments:
WorldPosition.hip (89.5 KB)

User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Hi patar,

Thanks for this…but maybe I should have explained more clearly.

Is there a way to directly enter a function or some form of referencing directly in the parameter textbox, instead of just using the typical relative/absolute channel reference format; Without creating extra nodes or any network setup.
User Avatar
Member
280 posts
Joined:
Offline
pls examine geo2

Best regards
Patar

Attachments:
WorldPosition2.hip (106.5 KB)

User Avatar
Member
280 posts
Joined:
Offline
the expression is kinda…..a mouthful…
User Avatar
Member
2042 posts
Joined: Sept. 2015
Offline
Cool patar,

I was looking at optransform earlier and saw the docs describing it in both expression and vex context.

In the vex context it lists it as returning a matrix and I looked up the matrix type and it shows it as a 4 x 4 fps.

I wasnt sure how to use/apply that.

Your example clarifies this.

So thanks very much.

And yeah, it might be a mouthful but I can see it being very usefull in some cases.
  • Quick Links