Manuel Villemur

Manuloti

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

How to reference @ptnum in a point() Expression Function Aug. 29, 2023, 7:24 p.m.

I mean, I get @curveu role in the procedure. I myself, since I didn't have any pre-existing geometry, I got my "0-1" value from dividing the total angle between the vectors, by an arbitrary value I used as a step, hence I... controlled the number of iterations (generated points) and the by adjusting that "current angle" in the the total angle range, I got my "rampos", or "u" in your example. I added some other goodies (using the blessed lerps xD) to "tame" it a little bit further to my taste (depending on the situation), and now I'm... generating the quads between the lines, but so far it looks like this, and I'm really happy about it.



Now, what I don't get, it's the... semantics in "how is it possible @curveu is evaluated if it appears after the chramp()". I don't come from a coding background (from graphics, not even computer graphics), so I don't "return P" xD, or declare "vector rotate_chramp(vector A,B,C; float u)". I was wondering if that was a vector4, but I don't think so, I guess it’s just another way of declaring the variables, etc. Is just… my flagrant ignorance on C, C++, Python and "all the above". For what is worth, VEX is the first "coding" language I do a relative deep dive in, nearly 2yrs so far, and mainly out of... the acknowledgement I have to explore it and utilize it daily and thoroughly to come up with solutions for procedural geometry projects.

Anyhow, I'm reaaaally thankful for the guidance : ) .

How to reference @ptnum in a point() Expression Function Aug. 26, 2023, 9:41 p.m.

Oh! I see now. @curveu is like... @uv.x whenever you apply a UV texture to a line and get a float value for each point present in the line, across its evolution. I ignored you could obtain it from a Resample node. And it's with that attribute you feed the "amount" argument in the lerp, I see.

The rotation I settled it with a slerp between the target quaternions, accounting the rotation between the v@dir I made, to both vectors that formed the angle and rotating the v@dir itself. When... looking at your example, it's crystal clear how I like to over complicate things, when it's way easier "mentally" to just rotate one of the vectors, along the scaled angle value formed between the two vectors.

I now also see why

BabaJ
But you can in a wrangle, reference an attribute per point with the same chramp parameter.

Instead I was trying to do it in the very parameter of the chramp, when indeed I could just use a lerp between the two target distances, and modulate it with the "amount" parameter in the VEX function itself. I guess I really didn't have in mind what lerp amounted for (not pun intended) and... got tangled in seeking a solution in Hscript muddy waters xD.

I personally don't work with matrix approaches "first", cause like any God fearing simple human they tend to intimidate me xD, but... in this example it's helps in order to see the "step by step" of the vector, from basic ident matrix, to be rotated and then displaced along. What I still don't incorporate is... how a "float u" is connected to the previously present f@curveu, without any "u = f@curveu", but that's anecdotal at this point xD.

__

Anyway, thanks both, I'll put this to work on Monday and see if I can make good use of it.

Noted: no need to reference an attribute from the current instanced point in a chramp parameter, when you can use a lerp and work with its "amount" argument.

Again, many thanks for the time and patience : )

How to reference @ptnum in a point() Expression Function Aug. 26, 2023, 11:43 a.m.

Yes! that example seems to do what I was aiming for. After posting my example I... realize I wasn't gaining much from trying to do it in the way I was. Being confused doesn't do us any good. But back to yours, what I don't understand is how a different value of that ramp (well, both ramps) is being instanced at each point cycle.

vector rotate_chramp(vector A,B,C; float u){...}

Firstmost, this is something I'm not familiarized with; that way of inicialzing. But most importantly, that float u is the one that acts as the "rampos" in the chramps, and I guess it takes from the @ptnum to indicate the "current position in the ramp"? . I could imagine fitting the @ptnum from 0 and the @numpt, to a 0-1, so the chramp can read that value, but I would be facing again the same hurdle I came here with, but this doesn't take place in your code, yet! It works correctly xD. How does the float u evolved in value across the Point Wrangle? I'm missing a part of the movie.

Thanks for taking the time to evaluate my case and even make an example for me to review : ) .

_

Ultemately, for anyone wondering about the initial question I made, I think the answer is pretty much... "no, you can't reference an attribute from the current instanced point in a chramp parameter"