Thiha Aung

thihaA

About Me

EXPERTISE
Developer
INDUSTRY
Gamedev

Connect

LOCATION
Singapore
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Access points by number in python Dec. 6, 2020, 12:43 a.m.

how to convert this vex code to python code to use in python sop node?

int pts = primpoints(0, @primnum);

int prim = addprim(0, “poly”);
for(int i=0; i<len(pts); i++){
int pt1 = pts;
int pt2 = pts;
vector pos1 = point(0, “P”, pt1);
vector pos2 = point(0, “P”, pt2);

vector npos1 = pos1 + (pos2-pos1) / 3.0;
vector npos2 = pos1 + (pos2-pos1) * 2.0 / 3.0;
matrix mat = ident();
rotate(mat, radians(-60), set(0, 1, 0));
vector npos3 = npos1 + (pos2 - pos1) / 3.0 * mat;
int npt1 = addpoint(0, npos1);
int npt2 = addpoint(0, npos2);
int npt3 = addpoint(0, npos3);

addvertex(0, prim, pt1);
addvertex(0, prim, npt1);
addvertex(0, prim, npt3);
addvertex(0, prim, npt2);
}

removeprim(0, @primnum, 1);