0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VEX、Houdiniで網かごをつくる

Posted at

線を作り、sin波を作り、それを重ね合い
網かごを作っていきます。

Lineノードはいいけど
計算が複雑になるのでVEXで作りました
image.png

vex
float x=chf("x");
float y=chf("y");
float z=chf("z");
float B=chf("Freq");
 
float fxd=x/B/4;
float fyd=y/B/2;
float fzd=z/B/4;

vector xd=set(fxd,0,0); vector xd1=set(fxd,1,0);
vector yd=set(fyd,0,0);
vector zd=set(fzd,0,0);

vex
vector xd=set(fxd,0,0); vector xd1=set(fxd,1,0);
vector yd=set(fyd,0,0);
vector zd=set(fzd,0,0);

for (int i=0;i<x/fxd;i++){
//Horizontal line
int a=addpoint(0, set(fxd*i,0,0));
int b=addpoint(0, set(fxd*i,0,z));
int ab=addprim(0,"polyline",a,b);
setprimgroup(0,"U",ab,1,"set");
setprimgroup(0,"U",cd,1,"set");
setprimgroup(0,"y",cd,1,"set");

//Vertical line
int c=addpoint(0, set(fxd*i,0,0));
int d=addpoint(0, set(fxd*i,y,0));
int cd=addprim(0,"polyline",c,d);


int e=addpoint(0, set(fxd*i,0,z));
int f=addpoint(0, set(fxd*i,y,z));
int ef=addprim(0,"polyline",e,f);
setprimgroup(0,"U",ef,1,"set");
setprimgroup(0,"y",ef,1,"set");
}
vex
for (int i=0;i<z/fzd;i++){

int g=addpoint(0, set(0,0,fzd*i));
int h=addpoint(0, set(x,0,fzd*i));
int gh=addprim(0,"polyline",g,h);
setprimgroup(0,"V",gh,1,"set");


//Horizontal line
int j=addpoint(0, set(0,0,fzd*i));
int k=addpoint(0, set(0,y,fzd*i));
int l=addpoint(0, set(x,0,fzd*i));
int m=addpoint(0, set(x,y,fzd*i));

int jk=addprim(0,"polyline",j,k);
int lm=addprim(0,"polyline",l,m);
setprimgroup(0,"V",jk,1,"set");
setprimgroup(0,"V",lm,1,"set");
setprimgroup(0,"y",jk,1,"set");
setprimgroup(0,"y",lm,1,"set");

}

vex

for (int i=0;i<1;i++){
int p=addpoint(0, set(x,y,0));
int q=addpoint(0, set(x,y,z));
int r=addpoint(0, set(0,y,z));
int s=addpoint(0, set(0,y,0));
setpointgroup(0,"top",p,1,"set");
setpointgroup(0,"top",q,1,"set");
setpointgroup(0,"top",r,1,"set");
setpointgroup(0,"top",s,1,"set");
int pqsr=addprim(0,"poly",p,q,r,s);
setprimgroup(0,"top",pqsr,1,"set");
}
vex
float x=chf("x");
float y=chf("y");
float z=chf("z");
float B=chf("Freq");

float fxd=x/B/4;float fyd=y/B/2;float fzd=z/B/4;

for (int i=0;i<y/fyd;i++){
int l=addpoint(0, set(x,fyd*i,0));
int m=addpoint(0, set(x,fyd*i,z));

int n=addpoint(0, set(x,fyd*i,0));
int o=addpoint(0, set(0,fyd*i,0));

int lm=addprim(0,"polyline",l,m);
int no=addprim(0,"polyline",n,o);
setprimgroup(0,"z",lm,1,"set");
setprimgroup(0,"x",no,1,"set");
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?