if (volumesample(1,"surface",@P)<0){
@Cd = set(1,0,0);
matrix3 m = dihedral(@v,{1,0,0});
vector newV = lerp(@v*m,@v,0.9);
@v = newV ;
}
dihedralVolume
int handle = pcopen(1,"P",@P,1,40);
vector tempV = pcfilter(handle,"N")*-1;
if (volumesample (2,"surface",@P)<0){
matrix3 m = dihedral(@vel,tempV);
vector newV = lerp(@vel*m,@vel,0);
@vel = newV;
}
else {@density=0;}
polyFlowN
//selection par orientation des normales
//red
if (dot(@N,{1,0,0})>ch("x")){
@Cd={1,0,0};
}
if (dot(@N,{-1,0,0})>ch("x")){
@Cd={1,0,0};
}
//green
if (dot(@N,{0,1,0})>ch("y")){
@Cd={0,1,0};
}
if (dot(@N,{0,-1,0})>ch("y")){
@Cd={0,1,0};
}
//blue
if (dot(@N,{0,0,1})>ch("z")){
@Cd={0,0,1};
}
if (dot(@N,{0,0,-1})>ch("z")){
@Cd={0,0,1};
}
//tweakNormal
if (@Cd.x>0.1){
@N= cross(@N,chv("rouge"));
}
else if (@Cd.y>0.1){
@N= cross(@N,chv("vert"));
}
else @N =cross(@N,chv("bleu"));
@N*=ch("normMult");