달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2021. 3. 9. 17:37

Joy of Vex Houdini/H_Practice2021. 3. 9. 17:37

www.tokeru.com/cgwiki/index.php?title=JoyOfVex

 

JoyOfVex - cgwiki

A 20 day program, each day aiming to be between 5 and 30 minutes plus exercises. Introduction There's a few stages to learning Houdini; getting into nodes and proceduralism is one, dynamics is another, vops is another. But the one that can seem the most da

www.tokeru.com

 

www.youtube.com/channel/UCehOp6tIqOqlFa7_-cpgw1Q

 

TWA 후디니의 정석

모든 랭글러를 위하여. 똭! TWA와 함께 하는 후디니 공부가 여러분의 학습에 조금이나마 도움이 되길. -TWA

www.youtube.com

 

** 불편해도 많이 써보고 감각이 올라와 있어야 필요할때 써먹을 수 있다.

 

Day 1.

   @Cd, @N, @P,

   @ptnum, @numpt - 정수이기때문에 float 계산시 float(@ptnum), float(@numpt) 로 사용.

   sin(), cos(), ch("name"), 

 

node: grid, add, switch, transform, normal, attribwrangle, merge, resample,

 

Day 2.

    length(), 원점에서의 거리

    distance(), 두 벡터 간의 거리

    fit(input,min,max,new_min,new_max) 범위를 새로운 범위로 변경

    clamp(input,min,max) 범위 제한

    @Time, chf, chv, chi

    버텍스 값 입력 방법: {0,0,0} 

 

Day 3.

    @P+@N, 

 

Day 4.

    chramp("name", value),  자동으로 value를 0~1사이값으로 변환해서 적용. (그래프 가로: 입력, 세로:출력)

    d + @Time, d - @Time 차이 구별.

    

Day 5.

    %(modulo), -0.2%1 = 0.8,  @Time%chf("flickering");

    floor(), 내림 함수 floor(0.6) = 0, floor(-1.8) =-2,

    ceil(), 올림함수 ceil(0.6) = 1,

    rint(), 반올림함수 rint(0.4)=0, rint(0.6)=1, round()함수는 없음.

    trunc(), 절사,버림 함수, trunc(0.9) = 0, trunc(-1.8) =-1, 점대칭

    frac(), 소수점 부분만. 1.8 = 0.8,

    abs(), 절대값, 

    edit parameter에서 변수입력 range값 변경하기.

    node: clip - 단면 확인용도.

 

Day 6.

    point, 점. (vector 위치정보)

    vertex, primitive가 되는 point의 개별 묶음 정보

    primitive, vertex로 만들어진 결과물, primitive wrangle에서는 @P는 읽기만 가능하다.

    node: foreach primitive, attribute vop,

 

Day 7.

    point(input,"attribute name", number), "P", "Cd"....    : vector 위치값 반환.

    s@test ="AAA" : string attribute.

    visualization (RMB) > scene +> marker 추가 : attribut에 따른 custom 마커 지정 가능.

    distance(a,b), 두 벡터간의 거리.

    minpos-오브젝트 기준으로 가까운 위치 vector찾기, (vector 위치 반환)

    nearpoint -가까운 포인트 넘버 찾기, : 포인트 넘버 반환

    @opinput1_xxx, P, Cd.... TWA에서는 설명을 다음으로 미룸.

    

    node: attribrandomize(랜덤하게 속성값을 지정, 속성값 생성도 가능, dimensions에서 몇차원값인지 지정,)

            pointjitter,(각 포인터를 랜덤한 위치로 변경)

            platonic solid, copy to points,

 

Q1.Noise

    random != noise  랜덤(독립적인값), 노이즈(흐름(연속성)이 있는 랜덤값)

    차원은 변수의 개수, frequency & offset & amplitude

    node: attribvop - vectortofloat, floattovector, bind, bind export, aanoise, constant, add, multiply

            vdbfrompolygon,pointsfromvolume, switch, groupexpression, blast, mountain,

 

Day 8.

    noise, curlnoise

 

Day 9. A

    normalize : 크기 1의 벡터로 만들기. 결과:vector

    dot(dot product): 내적,각도값.단위벡터일때 cos세타 값, 결과: float값

                        순서가 바껴도 결과는 같다. 

    cross product: 외적, 두벡터에 수직인 벡터,방향, 결과: vector (오른손 법칙),평행사변형의 넓이가 수직 길이.

                       순서가 바뀌면 방향이 바뀐다.

           cross product로 수직인 벡터를 구하고 구한벡터와 빛의 벡터를 normalize한다음

           dot product를 사용해 빛의 세기를 구한다.

 

    node: carve,

 

Day 9. B

    attribdelete, 

    copy reference, paste relative referenced,

    vector + - * 

    node: scatter, blast,

 

 

Day 10.

    @rel = float(@ptnum)/@numpt,  ptnum을 float로 형변환 해줘야 0~1값으로 계산된다.

    relpointbbox,

 

    node: bound, 

 

Day 11.

    if (  ) { } else if{ } else{ }..............  > < >= <= == != &&(and) ||(or)

    0 == sin($PI)  실제 계산된값은 정확한 0이 아닌 0.00000...87 이기때문에 거짓.

    즉 sin($PI) < 0.00001 과 같은 형태로 구성해줘야 한다.

    오브젝트의 @ptnum%5 모듈러 연산자로 랜덤한값 유도할수있다.

 

Day 12. A,B

     코딩 규칙, 물결효과(효과중첩 X)-개별 포인트별로 중첩.

 

Day 12. C

    nearpoints(input num, attrib, 반경), nearpoints(input num, attrib, 반경,개수),

    int TWA[], i[]@TWA, TWA[2][4],

 

Day 13.

    foreach(pt; pts[]),를 사용한 중첩. pt는 pts[] 배열에 있는 값이 순차적으로 적용된다.

    for( int i; i<0;i++),

    len(배열), 배열의 길이.

 

Day 14.

    개념> point : 점, vertex: primitive를 구성하는 요소, primitive : 선이나 면.

    int aa = addpoint(0,{0,0,0});   removepoint(0,aa);

    addprim(0,"polyline");      poly(면), polyline(선), 

    addvertex(0, 프리미티브이름, 포인트 이름),

 

   생성 순서 : 점생성 >프리미트브 생성 > 버텍스 추가. (연결되는 순서에 따라 면이 뒤집어진다.)

                 addpoint > addprim > addvertex

    addprim(0,"polyline",0,1) 포인트 넘버를 직접 대입해도 된다. 0~1의 line 생성

    addprim(0,"poly",0,1,2)

    addprim > addpoint >addvertex 실제 코딩때 적절한 순서.

 

    removepoint(0,point num)

    removevertex(0,vertex index)

    removeprim(0,prim number,option) option: 0 포인트를 남긴다, 1 포인트까지 지운다.

    rand(value,seed);

 

Day 15.

    node: copy to point , 속성값도 가져와서 x / + - 연산시킬수 있다.

            ^(not) ^Cd ^P.........

            Transform Using Target Point Orientations : orientation은 이 옵션으로만으로 제어한다.

                                                                (pscale, 방향 에 적용됨,N 노멀은 상관없다.)

 

    node: attribrandomize 속성값을 랜덤하하게 바꿔준다 . 

    

    pscale 전체 동일 비율로 크기 조절, scale : xyz 개별 크기 조절, 

  

    grid 의 면에 대한 방향때문에 copy to point 로 오브젝트를 복사하면 x축으로 90도 회전 되어 나타난다.

     ( grid >add 추가해서 점으로 변환 후 연결하면 해결, )

     (add가 없을때 point normal이 다르게 지정되어 있어서 나타는듯 > 노멀 수정 방법은 나중에 알아보기)

 

    chramp 타입을 color로 설정 가능.

 

 

Day 16.

    @up  @N 의 관계.  up 윗방향, N 정면

    포인트에 업벡터를 사용하려면 > @N={0,1,0}처럼 노멀을 추가한후 방향벡터를 구하고 노멀라이즈해서 사용.

    cos($F),sin($F)..

    edit모드 select 모드에서 버텍스 선택후 'E' 키. or edit 노드 추가.

    (edit 모드 후 highlight 포인트를 없애려면 edit node를 추가로 달아주면 된다)

     

   if( min(@Cd)<0){@Cd=0.1;}      min(@Cd)<0 , @Cd<0  비교 차이.

 

   copy to point 노드에 적용될때는 {0,0,1}의 방향이 기준이 된다.

 

 

Day 17. A

    @orient : 물체의 방향과 각도,  @orient = set(a,b,c,d), 

    @orient = quaternion(angle, axis), axis는 normalize 해서 단위벡터로 사용하도록.

    (@orient 값을 예측하거나 계산해서 대입하기 어려움 > 결과물 비쥬얼에 대한것만 고민할것)

 

Day 17. B, C

    1.쿼터니언 2개 인풋(angle, axis), 1개 인풋(vector)=(axis * angle).

    2. @N과 @up을 orient로 변환시키는 법. 

       @N과 @up이(원운동때) 수직이 아니면 튀어 보인다.

    3. 각도값을 orient로 변환시키는법

    4. orient 값을 mix 해주는 법

    5. orient값끼리 곱, 효과의 중첩.

    6. orient > matrix,  matrix > orient | maketransform <> qconvert.

    7. orient > matrix > @N,@up

 

    vector&float > vector >matrix >quaternion

    @N,@up >maketransform ->matrix >quaternion

    matrix3 AA, 3@AA,

    @N ={1,1,0}; @N = normalize(@N); 축의 크기가 1이 아닐때 부자연스럽게 움직임> normalize.

 

    ident() 단위행렬, 

    matrix3 ( a, b, c )

              ( d, e, f )   >@up

              ( g, h, i )   >@N

    

    @orient > qconvert 역변환 > matrix >@N, @up 확인 가능.

    

    eulertoquaternion(xyz각도(vector),축설정set). : 각도>@orient.  0:xyz,1:xzy,2:yzx,3:yzx,4:zxy,5:zyx, 

    radians(각도 값), $PI = 3.141592.....  $PI/2=90도

 

    rand(), noise() 결과 차이

    lerp(vector A,vector B,amount) :vector에 사용.

    slerp(vector4 A,vector4 B,amount)  : orient에 사용

    @Time%1.

    

    transform node: attributes : * ^orient 

    qmultiply (quaternion multiply) 두개의 쿼터니언 합. @orient = qmultiply(@orient, rot);

    {0,1,0}*qconvert(@orient) >@N,  {0,0,1}*qconvert(@orient) >@up

    배열에 매트릭스값 넣을때.

       matrix3 m = qconvert(@orient);
       vector a[] = set(m);

 

 

 

Day 18.

    spreadsheet > intrinsics 내재정보 (spreadsheet에서 primitive, detail 항목에서만 확인)

                      - 흰색으로 활성화 된 정보만 수정가능,회색은 수정 불가.

    primintrinsic( input, intrinsic name, prim number),        //point()함수와 사용법은 동일.

    @primnum, bounds, measuredarea(primitive 면적),

    setprimintrinsic( input, intrinsic name, prim number, value), //intrinsic 값을 입력.

    intrinsic:transform 정보는 point 점 하나에 primitive 하나를 가진 상황에서 나타난다.

    matrix 값의 사용에 따른 차이 : primitive - transfortm 모양 변경

                                             point - 방향과 회전의 양 (@orient)

    intrinsic: packedfulltransform (matrix4 값을 maxtrix3로 가져와서 @orient로 설정, 회전과 크기 정보)

    qmultiply() 두 쿼터니언의 곱,

 

node: pack(primitive가 아닐때(polygon) 추가하면 intrinsic:transform을 확인할수 있다),

        explodeview, isooffset, voronoifracture, dopnet, dopimport, material,

        dopnet > rbdfractureobject, rigidbodysolver, groundplane,gravity.

        dopimport > import style - fetch packed geometry from dop network

                                       / fetch unpacked geometry from dop network

   

Day 19.

    primuv(input,"attrib",input prim number,uv vector), ex) primuv(1,"P",0,{0.75,0.85,0}),

    grid >primitive type: NURBS 로 설정하면 primitive개수가 1개로 되어 오브젝트 전체를 따라가게 된다.

    xyzdist(input,@P or @Cd or @N, var int primnum, var vector uv) 

         : 가장 가까운곳의 float dist & int primnum, & vector uv 위치 값을 반환,변수는 미리 설정해둬야 한다.

           , (minpos, nearpoint, nearpoints), 

    

   node:scatter, blast, 

          scatter > output attributes >Prim UVW attribute : Cd

 

Day 20.

    nearpoints(input ref,@P,반경,개수):결과array값,input ref 참조해서 가까운 점 찾기,  

    pcfind(input ref,"P",원본@P,반경,개수):결과array값,input ref attrib를 참조해서 가까운 점 찾기.

    pcfind > nearpoints >nearpoint

    setpointattrib(0,"Cd "만들어주는 속성,point num어떤포인트, col,"set")

    foreach, len(array)배열길이,

 

    node: vdbfrompolygons > fog vdb, vdbvisualizetree, attribdelete,

            attribvop, circle >polygon>open arc,

 

    >P oint C louds

    int mypc = pcopen(input ref, "P",@P,반경,개수):각 포인트에서 만들어진 군집 정보,모든 attrib를 담고 있다.

                   file 정보로 출력. 대상"P"와 자기@P 를 비교해 가장 비슷한 것을 범위내 개수로 먼저 찾는다.

    pcfilter(mypc,"P"), 모든 포인트에 포지션에대한 평균값. 가지고 있는 attrib들의 평균을 구할수 있다.

    file,

    node: uvquickshade:텍스쳐 입히기, 

            attribvop: texture,

 

    > ambient occlusion : 거리와 노멀에 따른 방식에따라  빛에 대한 표현을 가상으로 만들어 주는것.

          평균값보다 높다,낮다 > 밝다,어둡다.

    dot, normalize, pow

 

 

 

 

'Houdini > H_Practice' 카테고리의 다른 글

-book : 후디니로 구현하는 알고리즘 디자인  (0) 2021.08.04
TWA study  (0) 2021.04.07
note  (0) 2017.05.08
Pyro FX  (0) 2017.03.22
:
Posted by fx0275