最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Houdini制作超立方體并導(dǎo)入unity

2023-08-13 17:51 作者:Fakeridah  | 我要投稿

??function float[] matrix_multiplication(vector4 mat_1[]; float mat_2[])

??{

????float result[];

????vector4 temp_matrix[];


????temp_matrix[0] = set( 0, 0, 0, 0 );

????temp_matrix[1] = set( 0, 0, 0, 0 );

????temp_matrix[2] = set( 0, 0, 0, 0 );

????temp_matrix[3] = set( 0, 0, 0, 0 );


????if (4 == len(mat_2))

????{

??????for (int i = 0; i < len(mat_1); i++)

??????{

????????for (int j = 0; j < 1; j++)

????????{

??????????float temp = 0;

??????????for (int k = 0; k <4; k++)

??????????{

????????????temp += mat_1[i][k] * mat_2[k];

??????????}

??????????temp_matrix[i][j] = temp;

????????}

??????}

????}


????result[0] = temp_matrix[0][0];

????result[1] = temp_matrix[1][0];

????result[2] = temp_matrix[2][0];

????result[3] = temp_matrix[3][0];


????return?result;

??};

???

??void DrawLine(int offset;int i;int j;vector4 final_coordinates[])

??{

????vector start = set(final_coordinates[i + offset][0], final_coordinates[i + offset][1], final_coordinates[i + offset][2]);

????vector end = set(final_coordinates[j + offset][0], final_coordinates[j + offset][1], final_coordinates[j + offset][2]);

?????

????int a = addpoint(0,start);

????int b = addpoint(0,end);

?????

????int aa = addprim(0,"polyline",a,b);

??}

???

float rot_speed=1.0f;

float theta = 0;

float cam_dist = 3;

int side_length = 5;

vector4 final_coordinates[];

vector4 coordinates[] ={{ -1, -1, -1, 1 },{ 1, -1, -1, 1 },{ 1, 1, -1, 1 },{ -1, 1, -1, 1 },

????????????{ -1, -1, 1, 1 },{ 1, -1, 1, 1 },{ 1, 1, 1, 1 },{ -1, 1, 1, 1 },

????????????{ -1, -1, -1, -1 },{ 1, -1, -1, -1 },{ 1, 1, -1, -1 },{ -1, 1, -1, -1 },

????????????{ -1, -1, 1, -1 },{ 1, -1, 1, -1 },{ 1, 1, 1, -1 },{ -1, 1, 1, -1 }};


?????????????

????theta += rot_speed*$F/50;


????vector4 rotation_matrix[] ;

????rotation_matrix[0] = set( 1, 0, 0, 0 );

????rotation_matrix[1] = set( 0, 1, 0, 0 );

????rotation_matrix[2] = set( 0, 0, cos(theta), -sin(theta) );

????rotation_matrix[3] = set( 0, 0, sin(theta), cos(theta) );


????for (int i = 0; i < 16; i++)

????{

??????float temp_coordinate_matrix[];


??????for (int k = 0; k < 4; k++)

??????{

????????temp_coordinate_matrix[k] = coordinates[i][k];

??????}


??????float rot_temp[] = matrix_multiplication(rotation_matrix, temp_coordinate_matrix);


??????float perspective_dist = 1 / (cam_dist - rot_temp[len(rot_temp) - 1]);


??????float proj_temp[];?


??????proj_temp[0] = perspective_dist * rot_temp[0] * side_length / 2;

??????proj_temp[1] = perspective_dist * rot_temp[1] * side_length / 2;

??????proj_temp[2] = perspective_dist * rot_temp[2] * side_length / 2;

??????proj_temp[3] = perspective_dist * rot_temp[3] * side_length / 2;


??????final_coordinates[i] = set(proj_temp[0], proj_temp[1], proj_temp[2], proj_temp[3]);

????}


????for (int i = 0; i < 8; i++)

????{

??????if (i < 4)

??????{

????????DrawLine(0, i, i + 4,final_coordinates);

????????DrawLine(0, i, i + 8,final_coordinates);

????????DrawLine(0, i, (i + 1) % 4,final_coordinates);

????????DrawLine(0, i + 4, ((i + 1) % 4) + 4,final_coordinates);


????????DrawLine(8, i, i + 4,final_coordinates);

????????DrawLine(8, i, (i + 1) % 4,final_coordinates);

????????DrawLine(8, i + 4, ((i + 1) % 4) + 4,final_coordinates);

??????}


??????DrawLine(0, i, i + 8,final_coordinates);

????}

Houdini制作超立方體并導(dǎo)入unity的評論 (共 條)

分享到微博請遵守國家法律
金华市| 巧家县| 吉林市| 胶南市| 浏阳市| 阿克陶县| 邹城市| 罗山县| 渝北区| 永福县| 吴旗县| 泰和县| 多伦县| 泊头市| 南充市| 泰安市| 双牌县| 海安县| 玉田县| 德庆县| 海原县| 岱山县| 河源市| 元江| 禄劝| 盱眙县| 浦江县| 台州市| 沅陵县| 阿城市| 扬中市| 肥东县| 安多县| 报价| 昭苏县| 黎城县| 即墨市| 静海县| 利津县| 怀来县| 穆棱市|