← 返回项目列表

Houdini 练习

​IDMap

Houdini

Houdini练习

ID Map地形

​IDMap

​在虚幻引擎读取IDMap

​在虚幻引擎使用Texture Array

程序化建模

程序化门

程序化门的Houdini图表

程序化门的参数

程序化柱子

程序化柱子的代码

程序化门的参数

​地形寻路

不同消耗下的路径

vector up = {0,1,0};
vector current_pos = v@P;

float slope_cost = (1 - pow(dot(v@N, up),4))*chf("slope_cost");
float convexity_cost = f@convexity * chf("convexity_cost");
float concavity_cost = f@concavity * chf("concavity_cost");
float ascent_cost;
float descent_cost;
float user_cost = f@attrib_cost*chf("user_attrib_cost");

int neighbours[] = neighbours(0,@ptnum);
float costs[]; resize(costs, len(neighbours));
int i = 0; foreach(int neighbour; neighbours){
    vector neighbour_pos = point(0, "P", neighbour);
    vector edge_dir = normalize(neighbour_pos - current_pos);
    if(edge_dir.y>0){
        ascent_cost = pow(dot(edge_dir,up),4)*chf("ascent_cost");
        descent_cost = 0;
    }
    else if(edge_dir.y<0){
        descent_cost = pow(dot(edge_dir,up),4)*chf("descent_cost");
        ascent_cost = 0;
    }
    costs[i] = (slope_cost + ascent_cost + descent_cost + 
    convexity_cost + concavity_cost + user_cost);// * chf("global_cost_multiplier");
    costs[i] *= chf("global_cost_multiplier");
    i++;
}

i[]@neighbours = neighbours;
f[]@cost = costs;

不同Cost的代码

截图