Jump to content

Procedural bridge: Orient controls


teshelman

Recommended Posts

Hello, I'm hoping for a bit of advice for a procedural bridge I'm trying to put together. I've found some great tutorials, so I have some basics down, but I'm trying to find a way to introduce some randomness in the board rotation, translation and scale, but to have control of those things elsewhere for an end user. I can set up UX/channel controls, no problem, I'm just having trouble getting that randomness per point along the curve (where the boards are being Copied To Points). I can have very nice pitch/yaw/roll controls via a Orientation Along Curve, but that's for the whole curve. How would I use those controls to randomize the board rotations, transforms and scales a bit based on a rand() that uses (ptnum+fudge factor) as a seed? Or is there a simpler way to make a "bounded/controlled randomness" for those boards and to control said randomness, based around the orient attribute coming from the Orientation Along Curve? Thank you!
Link to comment
Share on other sites

Yes, I gave that a shot earlier, but it doesn't meet the needs of this project.  Yes, it can introduce a little jitter, but it's not able to act on the yaw, pitch or roll specifically in a controllable, boundable way.  It can operate on the out, N and up, since those can be passed out of the OAC, but I'm having trouble finding the magic combination to use those to make the same controllable effect as the Yaw, Pitch and Roll sliders in the Orient Along Curve controls on a per point basis.  The Attribute Randomize also winds up flipping the direction of some of the normals along this particular curve, which isn't helpful.  That makes me think that I'll be needing quaternions at some point, but the tests I've done with those also don't unlock the magic combination to get the Yaw, Pitch and Roll controls, either.  Quats are more controllable, sort of, but I still need to learn more about how to precisely manipulate them.

Link to comment
Share on other sites

Fenolis, thank you.  I have been able to wrangle vectors via a few different methods, but that was a useful bit of information for better control.  I'm still having significant trouble getting the For Loop to do what I need it to.  I can make the vectors do exactly what I want, with or without the Orient Along Curve, but something is getting lost or mangled when I try to get the Copy to Points involved in the For Loop for the actual board placement.  Something in what the CTP does simply doesn't cooperate with the vector wrangling I'm doing, and I'm not sure how to get the two to play nice.

Link to comment
Share on other sites

If you operate on curves, you can also consider to use curve attributes like curveu as input for a random/noise function. It also has the advantage, that you can control the effect along the curve using a ramp for example. For Rotation you will only have up and N (or the cross product). For example "roll" is a rotation of up around N. Yaw is a rotation of N around the up vector. The order how you apply the transformations is essential.

rotation_up_noise.hipnc

Link to comment
Share on other sites

Aizatulin, I think that for this project, I might have to settle on something simple like that, yes, and thank you for the sample file.  I've used curveu, and you're right, it's helpful.  For learning's sake, I would still like to sort out what's happening, and ideally, develop full yaw, pitch and roll controls (as well as scale/transform along per-point vectors instead of world axes) that can work with the Copy to Points.  I think that's where I'm really running into trouble.  Vector control and matrix transforms are, for the most part, behaving.  It's just getting the CTP to play nice with them where I'm running into roadblocks, since I'm relying on that CTP to do work, but it's operating under different assumptions than I am, and I can't rip its guts out and reorganize them.

Link to comment
Share on other sites

OK,

if you want to look at copy to points, here is rough rebuild of the functionality using a for loop. In fact it is only scaling, rotating by (N,up) and translating the geo to the points. If you want other functionality, you can experiment in the loop and check, if it is possible in copy to points aswell. For many tasks copy to points is enough, but sometimes foreach is unavoidable.

rotation_up_noiseA.hipnc

Link to comment
Share on other sites

Aizatulin, thank you very much.  I've done a bit of digging into that file, and I'm not quite sure it'll do all that I have in mind, but it's definitely useful to have that CTP function split out that way, and I'm going to see about doing more vector shenanigans on top of what you've set up there.  Your time and help is much appreciated.

  • Like 1
Link to comment
Share on other sites

Aizatulin and anyone else still interested in this, I took Aizatulin's file and spliced in some tech from Fabricio Chamon's tutorial over here:

 

...that combination did what I was looking for.  Ultimately, it's all in the VEX shenanigans and the attendant sliders, found in the "copy_to_points_fake" node that Aizatulin started and I added to.  The attached file is 98% Aizatulin's work, I just added the VEX bits that I needed to create the behavior I was looking for (which I'll continue to tune with some fit, rand, ptnum and other shenanigans, of course).

Thank you all for your help!  I had to piece some things together and learn quite a bit about wrangling vectors, quaternions and matrices.  Ultimately, the VEX itself isn't all that complex, which is what I suspected, largely about faking local transformation/rotation space then splicing it in, but parsing the tutorials and sorting out how it all worked took some time for this non-programmer brain of mine to parse.  Designing the core logic of what I wanted this bridge engine to do took all of 2 minutes, but going from plain English to Vexatious Houdiniese was a bit of a process.  You folk who live and breathe this coding stuff are most impressive, and I greatly appreciate your help, all of you.

 

 

 

rotation_up_noiseA_Expanded.hipnc

Edited by teshelman
  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...