Procedurally generated random closed curve

   2906   4   1
User Avatar
Member
18 posts
Joined: Jan. 2020
Offline
Greetings,

I am new to Houdini (and 3D content creation) so this might be a beginner question. I'm trying to generate a random closed curve which will be used as a guide to develop a race track in my terrain. However, I've tried a few trick but it didn't work. What I did is I put a NURBS curve with four points, successfully created a circle but with a poly inside. How can I remove the face/primitive and keep the curve? (or is there any easy way to just create a closed curve (without a face in it).

To add more samples in my curve, I resampled it. But then I lost my curve's smoothness. Is there a way to add samples without breaking the smoothness?

The next step is to add a normal at X and Z direction (Y=0), and use mountain to randomize the curve. This works but sometimes, there's a cross in my curve. Is there a way to avoid cross in random curve?

The image below is my current attempt. Any advice would be grateful.



Thank you
Edited by jttarigan - Sept. 16, 2021 12:34:45

Attachments:
random closed curve.PNG (2.1 MB)

User Avatar
Member
94 posts
Joined: July 2019
Offline
There are whole bunch of helpful nodes for you

Attachments:
qucktrack.png (1.7 MB)
quicktrack.hipnc (197.3 KB)

User Avatar
Member
18 posts
Joined: Jan. 2020
Offline
this is exactly what I need (even better with smooth random Y value).

I have a few questions though
1. What is Tanget values? How was it generated? I've tried to look the page about polyframe but it does not describe any info regarding tangent and bitangent.
2. can you explain a bit about the VOP? I understand that it adds a random value to position. But how does it avoid cross in the curve? And what does tangentv do in this VOP?

Thanks before
User Avatar
Member
94 posts
Joined: July 2019
Offline
Docs describes it pretty well if you understand how vector math works. I'd recommend to watch the lesson to understand how to do basic operations and troubleshoot vectors with visualizers


First of all, Polyframe can recalculate normals. In our case(single flat poly) it's just +Y vector {0,1,0}

That's much easier to see how Polyframe works when Style parameter set to First Edge

But you need to set up second style - Two edges, to get Bitangent vector looks in the middle (that's not how it's actually calculates) of two neighbour edges.

Because you calculated Bitangent vector in right direction that makes unlikely any intersection between points, then you can add the bitangent(tangentv) vector to current point position and it will move point in direction and length of bitangent vector.

Also, you can multiply bitangent vector to any scalar value and change vector length to get interesting results for all points.
Edited by Faitel - Sept. 17, 2021 04:31:07

Attachments:
Polyframe_normals.png (2.6 MB)
Polyframe_FirstEdge.png (1.5 MB)
Polyframe_TwoEdges.png (1.5 MB)
VopSumOfPositionAndBitangentVectors.png (2.0 MB)
VopChangeBitangentLength.png (2.1 MB)

User Avatar
Member
18 posts
Joined: Jan. 2020
Offline
Thanks for the detailed explanation. I am a little bit weak in computer graphic math.
  • Quick Links