Showing posts with label points. Show all posts
Showing posts with label points. Show all posts

Monday, 22 September 2025

How to move point/points along a curve

Some wise words from Toadstorm on the odforce forum. 

Make your main curve, blast some points off that you want to move along this main curve..
The main curve goes into input "one" (2nd input) of both wrangles. The points wrap round too, which is cool.
Good for a stream of things moving along a curve constantly. Things to consider, different u-increment values per points.

If you want to do it manually, what you probably want to do is create a duplicate set of disconnected points via the Add SOP or whatever, and then use xyzdist() to determine their relative positions along the parametric U of the curve. This would be done in a point wrangle, with your disconnected points in input 0 and the original curve in input 1:

int posprim;
vector primuv;
float dist = xyzdist(1, @P, posprim, primuv);
f@u = primuv.x;

Then after that's been established, you can use a second wrangle with a parameter to add to that starting @u value and lock each point to the position along the curve that matches the new parametric U value:
 

float add_u = ch("add_u");
float new_u = (f@u + add_u) % 1.0; // wrap points if they go past 1.0
vector new_P = primuv(1, "P", 0, new_u);
@P = new_P;


a quick addition - it's probably worth making a new_N and getting the Normal from the curve too!
vector new_N=primuv(1,"N",0, new_u);
@P=new_N;

Monday, 26 September 2022

@scale

 I can't believe I've never used @scale....

@pscale is useful for uniformly scaling the instance/copied object onto a point. But what if you need to adjust the scale on a per-axis basis?

@scale=set(1,2,3);

this will scale the object by 2 in the Y, and 3 in the Z

woop woop

Tuesday, 28 January 2020

transparent points/ points with alpha, Arnold

Plug Alpha attribute using User Data Float into OPACITY of Standard shader (in geometry section)

Saturday, 30 March 2019

constraints between two different objects refresh redux ultra

I've probably made a post about this before. Or I thought I did. .. anyway. I only make notes about things as I actually do them :) Repetition is the key to learning !

If you're trying to create constraints between two different objects, say a bunch of bricks and a big big of plaster wall you have to approach your primitive constraints generation a little differently than usual.
Normally you would put a Connect Adjacent Pieces node down and this would draw lines between your closest points. However if you were to merge the bricks and plaster together and do this, you still end up with lines being generated between brick bits and plaster bits..when all you actually want are the lines exclusively between brick & plaster. Whew.

To achieve this you have to hijack the name attribute of your brick and plaster geometry so that Houdini thinks there are only two names to connect between. Instead of having "brick01,brick02,brick03,plaster01,plaster02,plaster03" you will have "brick,plaster". that's it.
In a Point Wrangle(for packed geo) or a Primitive Wrangle(if you are working with unpacked geo) for each of your objects do something like this -

s@original_name=@name;
s@name="objectA";

where objectA might be "brick", object B might be "plaster". Now merge these two mono-named objects together , promote the name  attribute to point level (if it isn't already) and apply the Connect Adjacent Pieces node to them. Now you should only see lines being generated between the two seperate groups of objects. Brick to Plaster. Plaster to Brick.
Finally you must bring back your original name, so use an attribute rename node for this..


Plug your nice sparkly constraints into the rest of your network!