Esempio n. 1
0
        void VerticeProc(V3[] vs)
        {
            int lenc  = vs.Length;
            int start = 0;

            for (int i = start; i < lenc; i++)
            {
                V3 tmpCo = vs[i];
                {
                    //\blenderSource\blender\source\blender\blenlib\BLI_math_matrix.h
                    // 軸オブジェクト中心の座標系に頂点を持っていく
                    tmpCo = TempMatrix.TransByMat(tmpCo).ToV3( );
                }
                if (i >= vs.Length)
                {
                    break;
                }
                // todo 距離で弾くのを早めにすれば最適化できそう
                if (tmpCo.Length( ) > Radius)
                {
                    continue;
                }
                V3    vec  = new V3(tmpCo.X, tmpCo.Y, tmpCo.Z);
                float facm = 1.0f - Fac;

                V3 nv = vec.GetNormalized( );

                nv.X *= Scale.X;
                nv.Y *= Scale.Y;
                nv.Z *= Scale.Z;
                // 多分軸座標系で回転させれば
                //nv = Rot.TransByMat( nv ).ToV3( );

                tmpCo = nv * Len * Fac + tmpCo * facm;
                {
                    // 軸中心の座標系頂点を元の位置に戻す
                    tmpCo = InvercePivot.TransByMat(tmpCo).ToV3( );
                }
                SphereVertice[i] = tmpCo;
            }
        }