Skip to content

Instantly share code, notes, and snippets.

@kickbase
Created February 20, 2018 14:28
Show Gist options
  • Select an option

  • Save kickbase/7b9d9360f9e96581f1b4fc32a81a17b5 to your computer and use it in GitHub Desktop.

Select an option

Save kickbase/7b9d9360f9e96581f1b4fc32a81a17b5 to your computer and use it in GitHub Desktop.
[ Houdini ] [ VEX ] point wrangle sample with JavaScript
var p0 = {
ptnum: 0,
numpt: 4,
Alpha: 1.0,
pscale: 0.0,
P: [0.0, 0.0, 1.0]
};
var p1 = {
ptnum: 1,
numpt: 4,
Alpha: 1.0,
pscale: 0.0,
P: [0.0, 0.0, -1.0]
};
var p2 = {
ptnum: 2,
numpt: 4,
Alpha: 1.0,
pscale: 0.0,
P: [1.0, 0.0, 0.0]
};
var p3 = {
ptnum: 3,
numpt: 4,
Alpha: 1.0,
pscale: 0.0,
P: [-1.0, 0.0, 0.0]
};
var points = [p0, p1, p2, p3];
for (var i = 0; i < points.length; i++) {
var point = points[i];
// VEXpression code is here
console.log("point.ptnum: " + point.ptnum); //VEX: @ptnum
console.log("point.numpt: " + point.numpt); //VEX: @numpt
console.log("point.P: " + point.P); //VEX: @P
console.log("point.P[0]: " + point.P[0]); //VEX: @P.x or @P.r or @P[0]
console.log("point.Alpha: " + point.Alpha); //VEX: @Alpha
console.log("point.pscale: " + point.pscale); //VEX: @pscale
console.log("-----");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment