What & How & Why

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
vfx:houdini:vex:functions [2020/05/14 01:55] – [Geometry] codingharevfx:houdini:vex:functions [2020/05/14 02:00] (当前版本) – 移除 codinghare
行 1: 行 1:
-======VEX Concepts & Refs====== 
-//Ver. 18.0//  
-//VEX 的函数相关// 
-===== ===== 
- 
- 
- 
- 
- 
- 
-====MEASURE==== 
-===BoundingBox=== 
-==Getbbox_min / max== 
-<code vex> 
-//功能:返回当前几何体 bounding box 的 min / max 点 
-//返回:函数返回类型为 Vector,为 min / max 的坐标。 
-/* 使用 */ 
-//以 vec 的形式返回当前几何体 Bounding Box 的 min / max 点 
-//这两个点用于定义 Boundingbox(AABB) 
-vector  getbbox_max(geometry) 
-//也可以返回指定 primtive group 的 min / max 
-vector  getbbox_max(geometry, string primgroup) 
-</code> 
-====NOISE AND RANDOMNESS==== 
-==Rand== 
-<code vex> 
-//功能:根据指定的种子产生一个[0,1]的随机数 
-//返回:该函数可以返回 float、vec2、vec3、vec4 的随机数。 
-//所有随机数的范围均在 [0,1] 之间,根据 seed 的不同来决定。 
-//根据操作系统的不同,同一个 seed 也可能导致不同的随机数结果。 
-/* 使用 */ 
-float rand(seed); //返回类型为 float 的随机数 
-//如果返回是 vector,那么每一个分量的随机数都将不同。这种情况下如果需要做uniform scale,那么需要先将 vec 转化为 float: 
-vector pos = 1; 
-float seed = 0; 
-pos *= rand(seed); //random number are differernt in x,y,z 
-pos *= float(rand(seed));// uniformed random number 
- 
-</code> 
-====VOLUME==== 
-===Volume=== 
-==Volumesample== 
-<code vex> 
-//功能:对 volume 中的指定属性进行采样 
-//返回:该函数返回类型为 float,返回值为采样的结果。在 @primum、@inputnum 越界的情况下或者被采样 volume 不是 vector voulme 的情况下返回 0。 
-/* 使用 */ 
-//对指定数据进行采样 
-//geometry 可以为 handle 类型,也可以为路径 
-volumesample(int input_number, int primitive_number, vector position); 
-volumesample(int input_number, int "volume_name", vector position); 
-</code>