当前位置:网站首页>Houdini script vex learning
Houdini script vex learning
2022-06-12 06:02:00 【Senior brother Dai Dai】
Vex Preface
Vex yes Houdini Control script , Grammatical similarity C/C++, It is convenient to write a program for manipulating geometric data .
Octahedral array program
void add_pyramid(vector pos)
{
int p0 = addpoint(0, pos + {1, 0, 1});
int p1 = addpoint(0, pos + {1, 0, -1});
int p2 = addpoint(0, pos + {-1, 0, 1});
int p3 = addpoint(0, pos + {-1, 0, -1});
int p4 = addpoint(0, pos + {0, 1.5, 0});
int p5 = addpoint(0, pos + {0, -1.5, 0});
addprim(0, "poly", p2, p4, p0);
addprim(0, "poly", p0, p4, p1);
addprim(0, "poly", p1, p4, p3);
addprim(0, "poly", p3, p4, p2);
addprim(0, "poly", p0, p5, p2);
addprim(0, "poly", p1, p5, p0);
addprim(0, "poly", p3, p5, p1);
addprim(0, "poly", p2, p5, p3);
}
int row = chi("row");
int colume = chi("colume");
if(row >= 1 && colume >= 1)
{
for(int x = 0; x < row; ++x)
{
for(int y = 0; y < colume; ++y)
{
add_pyramid(set(2 * x, 2 * y, 0));
}
}
}
Ripple deformation of pig head
vector inf_pos = point(1, 'P', 0);
float radius = chf("radius");
int handle = pcopen(0, 'P', inf_pos, radius, chi("max_points"));
int ptnum = -1;
float distance = 0.0;
while (pciterate(handle))
{
pcimport(0, "point:number", ptnum);
pcimport(0, "point:distance", distance);
if(distance > radius - chf("threshold"))
{
vector pos = point(0, "P", ptnum);
vector dir = normalize(pos - inf_pos);
setpointattrib(0, "P", ptnum, pos + dir * chf("push_distance"));
setpointattrib(0, "Cd", ptnum, {1, 1, 0});
}
else
{
setpointattrib(0, "Cd", ptnum, {0, 0, 1});
}
}


Reference material
https://www.bilibili.com/video/BV1Zp411d7Hw?p=1
边栏推荐
- 468. verifying the IP address
- Halcon uses points to fit a plane
- Chapter 7 - pointer learning
- json-c常用API
- Leetcode-1512. Number of good pairs
- 数据库实验三:数据查询
- Recursive implementation of exponential, permutation and combination enumerations
- nus_data_handler源码解读结构体等数据类型
- [gpio] how to modify / display GPIO status through ADB shell
- Leetcode-1552. Magnetic force between two balls
猜你喜欢

Understanding of distributed transactions

Introduction to sringmvc

A preliminary understanding of function

Lock and reentrankload

Chapter 7 - pointer learning

A month's worth of DDD will help you master it

BlockingQueue interface introduction
![Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]](/img/25/b3c475e2b03c39b7c576b6d01f9d56.jpg)
Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]

Redis persistence

前台展示LED数字(计算器上数字类型)
随机推荐
R language homework (IV): GDP value analysis of Shanghai and Tokyo from 1997 to 2018
Why doesn't the database use binary tree, red black tree, B tree and hash table? Instead, a b+ tree is used
User login 【 I 】
nRF52832自定義服務與特性
Leetcode-553. Optimal division
Introduction to thread pool: ThreadPoolExecutor
A preliminary understanding of function
Es6-es11 learning
Why do I object so [1.01 to the power of 365 and 0.99 to the power of 365]
Research Report on water sports shoes industry - market status analysis and development prospect forecast
March 22, 2021
Brief introduction to project development process
交叉编译libev
The application could not be installed: INSTALL_ FAILED_ TEST_ ONLY
为什么联合索引是最左匹配原则?
Leetcode buckle -10 Regular expression matching analysis [recursion and dynamic programming]
数据库实验二:数据更新
Automatic annotation of target detection based on lffd model to generate XML file
Json-c common APIs
数据集成框架SeaTunnel学习笔记