Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-21 21:24:21 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-21 21:24:21 +0400
commit9064978d0bcd3684d48d3b64d41e650467d27e01 (patch)
treeb881f8c7c8cd19b88ad10a849ae2426c2361548e /source
parent4041c5775650f04d813ad867299daa4fa75e43ef (diff)
Remove unused code left from old multires interpolation stuff
- Removed validate() callback for MDisps layer. It wouldn't actually work correct from CustomData layer and all needed data might be validated from BMesh interpolation level. Also this callback was never actually used in BMesh, so can't see why we'll want to have it in structures. - Removed layrInterp_mdisps callback. Interpolation now happens from another level (bmesh_interp) and this callback isn't needed anymore. - Removed all function from multires.c which were used by old interpolation stuff and seems to be useless for other usages. - multires_topology_changed is still marked as a TODO, Probably it's not needed anymore, buy better to keep for now until it'll be 100% clear this function isn't needed and all needed re-allocations happens in bmesh_interp. Otherwise, it'll be needed to be ported to new system.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_multires.h6
-rw-r--r--source/blender/blenkernel/intern/customdata.c164
-rw-r--r--source/blender/blenkernel/intern/multires.c388
3 files changed, 2 insertions, 556 deletions
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index bbf87c186e3..b1fa375388a 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -88,19 +88,13 @@ void multiresModifier_scale_disp(struct Scene *scene, struct Object *ob);
void multiresModifier_prepare_join(struct Scene *scene, struct Object *ob, struct Object *to_ob);
int multires_mdisp_corners(struct MDisps *s);
-void multires_mdisp_smooth_bounds(struct MDisps *disps);
/* update multires data after topology changing */
void multires_topology_changed(struct Scene *scene, struct Object *ob);
/**** interpolation stuff ****/
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v);
-void mdisp_rot_crn_to_face(const int S, const int corners, const int face_side, const float x, const float y, float *u, float *v);
int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
-int mdisp_rot_face_to_quad_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y);
-void mdisp_apply_weight(const int S, const int corners, int x, int y, const int face_side, float crn_weight[4][2], float *u_r, float *v_r);
-void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]);
-void mdisp_join_tris(struct MDisps *dst, struct MDisps *tri1, struct MDisps *tri2);
#endif // __BKE_MULTIRES_H__
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 285496601f5..f019fb740fb 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -120,11 +120,6 @@ typedef struct LayerTypeInfo {
/* a function to determine file size */
size_t (*filesize)(CDataFile *cdf, void *data, int count);
-
- /* a function to validate layer contents depending on
- * sub-elements count
- */
- void (*validate)(void *source, int sub_elements);
} LayerTypeInfo;
static void layerCopy_mdeformvert(const void *source, void *dest,
@@ -445,142 +440,6 @@ static void layerSwap_mdisps(void *data, const int *ci)
}
}
-#if 1 /* BMESH_TODO: place holder function, dont actually interp */
-static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
- float *UNUSED(sub_weights), int UNUSED(count), void *dest)
-{
-#if 0
- MDisps *d = dest;
-
- /* happens when flipping normals of newly created mesh */
- if(!d->totdisp) {
- d->totdisp = ((MDisps*)sources[0])->totdisp;
- }
-
- if (!d->disps && d->totdisp)
- d->disps = MEM_callocN(sizeof(float)*3*d->totdisp, "blank mdisps in layerInterp_mdisps");
-#else
- (void) sources;
- (void) dest;
-#endif
-}
-
-#else // BMESH_TODO
-
-static void layerInterp_mdisps(void **sources, float *UNUSED(weights),
- float *sub_weights, int count, void *dest)
-{
- MDisps *d = dest;
- MDisps *s = NULL;
- int st, stl;
- int i, x, y;
- int side, S, dst_corners, src_corners;
- float crn_weight[4][2];
- float (*sw)[4] = (void*)sub_weights;
- float (*disps)[3], (*out)[3];
-
- /* happens when flipping normals of newly created mesh */
- if(!d->totdisp)
- return;
-
- s = sources[0];
- dst_corners = multires_mdisp_corners(d);
- src_corners = multires_mdisp_corners(s);
-
- if(sub_weights && count == 2 && src_corners == 3) {
- src_corners = multires_mdisp_corners(sources[1]);
-
- /* special case -- converting two triangles to quad */
- if(src_corners == 3 && dst_corners == 4) {
- MDisps tris[2];
- int vindex[4] = {0};
-
- for(i = 0; i < 2; i++)
- for(y = 0; y < 4; y++)
- for(x = 0; x < 4; x++)
- if(sw[x+i*4][y])
- vindex[x] = y;
-
- for(i = 0; i < 2; i++) {
- float sw_m4[4][4] = {{0}};
- int a = 7 & ~(1 << vindex[i*2] | 1 << vindex[i*2+1]);
-
- sw_m4[0][vindex[i*2+1]] = 1;
- sw_m4[1][vindex[i*2]] = 1;
-
- for(x = 0; x < 3; x++)
- if(a & (1 << x))
- sw_m4[2][x] = 1;
-
- tris[i] = *((MDisps*)sources[i]);
- tris[i].disps = MEM_dupallocN(tris[i].disps);
- layerInterp_mdisps(&sources[i], NULL, (float*)sw_m4, 1, &tris[i]);
- }
-
- mdisp_join_tris(d, &tris[0], &tris[1]);
-
- for(i = 0; i < 2; i++)
- MEM_freeN(tris[i].disps);
-
- return;
- }
- }
-
- /* For now, some restrictions on the input */
- if(count != 1 || !sub_weights) {
- for(i = 0; i < d->totdisp; ++i)
- zero_v3(d->disps[i]);
-
- return;
- }
-
- /* Initialize the destination */
- disps = MEM_callocN(3*d->totdisp*sizeof(float), "iterp disps");
-
- side = sqrt(d->totdisp / dst_corners);
- st = (side<<1)-1;
- stl = st - 1;
-
- sw= (void*)sub_weights;
- for(i = 0; i < 4; ++i) {
- crn_weight[i][0] = 0 * sw[i][0] + stl * sw[i][1] + stl * sw[i][2] + 0 * sw[i][3];
- crn_weight[i][1] = 0 * sw[i][0] + 0 * sw[i][1] + stl * sw[i][2] + stl * sw[i][3];
- }
-
- multires_mdisp_smooth_bounds(s);
-
- out = disps;
- for(S = 0; S < dst_corners; S++) {
- float base[2], axis_x[2], axis_y[2];
-
- mdisp_apply_weight(S, dst_corners, 0, 0, st, crn_weight, &base[0], &base[1]);
- mdisp_apply_weight(S, dst_corners, side-1, 0, st, crn_weight, &axis_x[0], &axis_x[1]);
- mdisp_apply_weight(S, dst_corners, 0, side-1, st, crn_weight, &axis_y[0], &axis_y[1]);
-
- sub_v2_v2(axis_x, base);
- sub_v2_v2(axis_y, base);
- normalize_v2(axis_x);
- normalize_v2(axis_y);
-
- for(y = 0; y < side; ++y) {
- for(x = 0; x < side; ++x, ++out) {
- int crn;
- float face_u, face_v, crn_u, crn_v;
-
- mdisp_apply_weight(S, dst_corners, x, y, st, crn_weight, &face_u, &face_v);
- crn = mdisp_rot_face_to_quad_crn(src_corners, st, face_u, face_v, &crn_u, &crn_v);
-
- old_mdisps_bilinear((*out), &s->disps[crn*side*side], side, crn_u, crn_v);
- mdisp_flip_disp(crn, dst_corners, axis_x, axis_y, *out);
- }
- }
- }
-
- MEM_freeN(d->disps);
- d->disps = disps;
-}
-#endif // BMESH_TODO
-
static void layerCopy_mdisps(const void *source, void *dest, int count)
{
int i;
@@ -600,25 +459,6 @@ static void layerCopy_mdisps(const void *source, void *dest, int count)
}
}
-static void layerValidate_mdisps(void *data, int sub_elements)
-{
-#if 1 /*BMESH_TODO*/
- (void)data;
- (void)sub_elements;
-#else
- MDisps *disps = data;
- if(disps->disps) {
- int corners = multires_mdisp_corners(disps);
-
- if(corners != sub_elements) {
- MEM_freeN(disps->disps);
- disps->totdisp = disps->totdisp / corners * sub_elements;
- disps->disps = MEM_callocN(3*disps->totdisp*sizeof(float), "layerValidate_mdisps");
- }
- }
-#endif
-}
-
static void layerFree_mdisps(void *data, int count, int UNUSED(size))
{
int i;
@@ -1124,9 +964,9 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
{sizeof(float)*4*4, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 19: CD_MDISPS */
{sizeof(MDisps), "MDisps", 1, NULL, layerCopy_mdisps,
- layerFree_mdisps, layerInterp_mdisps, layerSwap_mdisps, NULL,
+ layerFree_mdisps, NULL, layerSwap_mdisps, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps, layerValidate_mdisps},
+ layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps},
/* 20: CD_WEIGHT_MCOL */
{sizeof(MCol)*4, "MCol", 4, "WeightCol", NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol},
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index e7320ddf5dc..dbac2e756a5 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -1948,225 +1948,8 @@ void multires_topology_changed(Scene *scene, Object *ob)
}
#endif // BMESH_TODO
-/* makes displacement along grid boundary symmetrical */
-void multires_mdisp_smooth_bounds(MDisps *disps)
-{
- int x, y, side, S, corners;
- float (*out)[3];
-
- corners = multires_mdisp_corners(disps);
- side = sqrt(disps->totdisp / corners);
-
- out = disps->disps;
- for(S = 0; S < corners; S++) {
- for(y = 0; y < side; ++y) {
- for(x = 0; x < side; ++x, ++out) {
- float (*dispgrid)[3];
- float *data;
-
- if(x != 0 && y != 0) continue;
-
- if(corners == 4) {
- if(S == 0) {
- if(y == 0) {
- dispgrid = &disps->disps[1*side*side];
- data = dispgrid[side * x + 0];
-
- (*out)[0] = (*out)[0] + data[1];
- (*out)[1] = (*out)[1] - data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = -(*out)[1];
- data[1] = (*out)[0];
- data[2] = (*out)[2];
- } else if (x == 0) {
- dispgrid = &disps->disps[3 * side * side];
- data = dispgrid[side * 0 + y];
-
- (*out)[0] = (*out)[0] - data[1];
- (*out)[1] = (*out)[1] + data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = (*out)[1];
- data[1] = -(*out)[0];
- data[2] = (*out)[2];
- }
- } else if (S == 2) {
- if(y == 0) {
- dispgrid = &disps->disps[3 * side * side];
- data = dispgrid[side * x + 0];
-
- (*out)[0] = (*out)[0] + data[1];
- (*out)[1] = (*out)[1] - data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = -(*out)[1];
- data[1] = (*out)[0];
- data[2] = (*out)[2];
- } else if(x == 0) {
- dispgrid = &disps->disps[1 * side * side];
- data = dispgrid[side * 0 + y];
-
- (*out)[0] = (*out)[0] - data[1];
- (*out)[1] = (*out)[1] + data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = (*out)[1];
- data[1] = -(*out)[0];
- data[2] = (*out)[2];
- }
- }
- } else if (corners == 3) {
- if(S == 0) {
- if(y == 0) {
- dispgrid = &disps->disps[1*side*side];
- data = dispgrid[side * x + 0];
-
- (*out)[0] = (*out)[0] + data[1];
- (*out)[1] = (*out)[1] - data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = -(*out)[1];
- data[1] = (*out)[0];
- data[2] = (*out)[2];
- } else if (x == 0) {
- dispgrid = &disps->disps[2 * side * side];
- data = dispgrid[side * 0 + y];
-
- (*out)[0] = (*out)[0] - data[1];
- (*out)[1] = (*out)[1] + data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = (*out)[1];
- data[1] = -(*out)[0];
- data[2] = (*out)[2];
- }
- } else if (S == 2) {
- if(x == 0) {
- dispgrid = &disps->disps[1 * side * side];
- data = dispgrid[side * 0 + y];
-
- (*out)[0] = (*out)[0] - data[1];
- (*out)[1] = (*out)[1] + data[0];
- (*out)[2] = (*out)[2] + data[2];
-
- mul_v3_fl(*out, 0.5);
-
- data[0] = (*out)[1];
- data[1] = -(*out)[0];
- data[2] = (*out)[2];
- }
- }
- }
- }
- }
- }
-}
-
/***************** Multires interpolation stuff *****************/
-static void mdisp_get_crn_rect(int face_side, float crn[3][4][2])
-{
- float offset = face_side*0.5f - 0.5f;
- float mid[2];
-
- mid[0] = offset * 4 / 3;
- mid[1] = offset * 2 / 3;
-
- crn[0][0][0] = mid[0]; crn[0][0][1] = mid[1];
- crn[0][1][0] = offset; crn[0][1][1] = 0;
- crn[0][2][0] = 0; crn[0][2][1] = 0;
- crn[0][3][0] = offset; crn[0][3][1] = offset;
-
- crn[1][0][0] = mid[0]; crn[1][0][1] = mid[1];
- crn[1][1][0] = offset * 2; crn[1][1][1] = offset;
- crn[1][2][0] = offset * 2; crn[1][2][1] = 0;
- crn[1][3][0] = offset; crn[1][3][1] = 0;
-
- crn[2][0][0] = mid[0]; crn[2][0][1] = mid[1];
- crn[2][1][0] = offset; crn[2][1][1] = offset;
- crn[2][2][0] = offset * 2; crn[2][2][1] = offset * 2;
- crn[2][3][0] = offset * 2; crn[2][3][1] = offset;
-}
-
-static int mdisp_pt_in_crn(float p[2], float crn[4][2])
-{
- float v[2][2];
- float a[2][2];
-
- sub_v2_v2v2(v[0], crn[1], crn[0]);
- sub_v2_v2v2(v[1], crn[3], crn[0]);
-
- sub_v2_v2v2(a[0], p, crn[0]);
- sub_v2_v2v2(a[1], crn[2], crn[0]);
-
- if(cross_v2v2(a[0], v[0]) * cross_v2v2(a[1], v[0]) < 0)
- return 0;
-
- if(cross_v2v2(a[0], v[1]) * cross_v2v2(a[1], v[1]) < 0)
- return 0;
-
- return 1;
-}
-
-static void face_to_crn_interp(float u, float v, float v1[2], float v2[2], float v3[2], float v4[2], float *x)
-{
- float a = (v4[1]-v3[1])*v2[0]+(-v4[1]+v3[1])*v1[0]+(-v2[1]+v1[1])*v4[0]+(v2[1]-v1[1])*v3[0];
- float b = (v3[1]-v)*v2[0]+(v4[1]-2*v3[1]+v)*v1[0]+(-v4[1]+v3[1]+v2[1]-v1[1])*u+(v4[0]-v3[0])*v-v1[1]*v4[0]+(-v2[1]+2*v1[1])*v3[0];
- float c = (v3[1]-v)*v1[0]+(-v3[1]+v1[1])*u+v3[0]*v-v1[1]*v3[0];
- float d = b * b - 4 * a * c;
- float x1, x2;
-
- if(a == 0) {
- *x = -c / b;
- return;
- }
-
- x1 = (-b - sqrtf(d)) / (2 * a);
- x2 = (-b + sqrtf(d)) / (2 * a);
-
- *x = maxf(x1, x2);
-}
-
-void mdisp_rot_crn_to_face(const int S, const int corners, const int face_side, const float x, const float y, float *u, float *v)
-{
- float offset = face_side*0.5f - 0.5f;
-
- if(corners == 4) {
- if(S == 1) { *u= offset + x; *v = offset - y; }
- if(S == 2) { *u= offset + y; *v = offset + x; }
- if(S == 3) { *u= offset - x; *v = offset + y; }
- if(S == 0) { *u= offset - y; *v = offset - x; }
- } else {
- float crn[3][4][2], vec[4][2];
- float p[2];
-
- mdisp_get_crn_rect(face_side, crn);
-
- interp_v2_v2v2(vec[0], crn[S][0], crn[S][1], x / offset);
- interp_v2_v2v2(vec[1], crn[S][3], crn[S][2], x / offset);
- interp_v2_v2v2(vec[2], crn[S][0], crn[S][3], y / offset);
- interp_v2_v2v2(vec[3], crn[S][1], crn[S][2], y / offset);
-
- isect_seg_seg_v2_point(vec[0], vec[1], vec[2], vec[3], p);
-
- (*u) = p[0];
- (*v) = p[1];
- }
-}
-
/* Find per-corner coordinate with given per-face UV coord */
int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y)
{
@@ -2210,174 +1993,3 @@ int mdisp_rot_face_to_crn(const int corners, const int face_side, const float u,
return S;
}
-
-/* Find per-corner coordinate with given per-face UV coord
- Practically as the previous funciton but it assumes a bit different coordinate system for triangles
- which is optimized for MDISP layer interpolation:
-
- v
- ^
- | /|
- | / |
- | / |
- |/______|___> u
-
- */
-int mdisp_rot_face_to_quad_crn(const int corners, const int face_side, const float u, const float v, float *x, float *y)
-{
- const float offset = face_side*0.5f - 0.5f;
- int S = 0;
-
- if (corners == 4) {
- if(u <= offset && v <= offset) S = 0;
- else if(u > offset && v <= offset) S = 1;
- else if(u > offset && v > offset) S = 2;
- else if(u <= offset && v >= offset) S = 3;
-
- if(S == 0) {
- *y = offset - u;
- *x = offset - v;
- } else if(S == 1) {
- *x = u - offset;
- *y = offset - v;
- } else if(S == 2) {
- *y = u - offset;
- *x = v - offset;
- } else if(S == 3) {
- *x= offset - u;
- *y = v - offset;
- }
- } else {
- float crn[3][4][2];
- float p[2] = {u, v};
-
- mdisp_get_crn_rect(face_side, crn);
-
- for (S = 0; S < 3; ++S) {
- if (mdisp_pt_in_crn(p, crn[S]))
- break;
- }
-
- face_to_crn_interp(u, v, crn[S][0], crn[S][1], crn[S][3], crn[S][2], &p[0]);
- face_to_crn_interp(u, v, crn[S][0], crn[S][3], crn[S][1], crn[S][2], &p[1]);
-
- *x = p[0] * offset;
- *y = p[1] * offset;
- }
-
- return S;
-}
-
-void mdisp_apply_weight(const int S, const int corners, int x, int y, const int face_side,
- float crn_weight[4][2], float *u_r, float *v_r)
-{
- float u, v, xl, yl;
- float mid1[2], mid2[2], mid3[2];
-
- mdisp_rot_crn_to_face(S, corners, face_side, x, y, &u, &v);
-
- if(corners == 4) {
- xl = u / (face_side - 1);
- yl = v / (face_side - 1);
-
- mid1[0] = crn_weight[0][0] * (1 - xl) + crn_weight[1][0] * xl;
- mid1[1] = crn_weight[0][1] * (1 - xl) + crn_weight[1][1] * xl;
- mid2[0] = crn_weight[3][0] * (1 - xl) + crn_weight[2][0] * xl;
- mid2[1] = crn_weight[3][1] * (1 - xl) + crn_weight[2][1] * xl;
- mid3[0] = mid1[0] * (1 - yl) + mid2[0] * yl;
- mid3[1] = mid1[1] * (1 - yl) + mid2[1] * yl;
- } else {
- yl = v / (face_side - 1);
-
- if(v == face_side - 1) xl = 1;
- else xl = 1 - (face_side - 1 - u) / (face_side - 1 - v);
-
- mid1[0] = crn_weight[0][0] * (1 - xl) + crn_weight[1][0] * xl;
- mid1[1] = crn_weight[0][1] * (1 - xl) + crn_weight[1][1] * xl;
- mid3[0] = mid1[0] * (1 - yl) + crn_weight[2][0] * yl;
- mid3[1] = mid1[1] * (1 - yl) + crn_weight[2][1] * yl;
- }
-
- *u_r = mid3[0];
- *v_r = mid3[1];
-}
-
-void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3])
-{
- float crn_x[2], crn_y[2];
- float vx[2], vy[2], coord[2];
-
- if (corners == 4) {
- float x[4][2] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}};
- float y[4][2] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
-
- copy_v2_v2(crn_x, x[S]);
- copy_v2_v2(crn_y, y[S]);
-
- mul_v2_v2fl(vx, crn_x, disp[0]);
- mul_v2_v2fl(vy, crn_y, disp[1]);
- add_v2_v2v2(coord, vx, vy);
-
- project_v2_v2v2(vx, coord, axis_x);
- project_v2_v2v2(vy, coord, axis_y);
-
- disp[0] = len_v2(vx);
- disp[1] = len_v2(vy);
-
- if(dot_v2v2(vx, axis_x) < 0)
- disp[0] = -disp[0];
-
- if(dot_v2v2(vy, axis_y) < 0)
- disp[1] = -disp[1];
- } else {
- /* XXX: it was very overhead code to support displacement flipping
- for case of tris without visible profit.
- Maybe its not really big limitation? for now? (nazgul) */
- disp[0] = 0;
- disp[1] = 0;
- }
-}
-
-/* Join two triangular displacements into one quad
- Corners mapping:
- 2 -------- 3
- | \ tri2 |
- | \ |
- | tri1 \ |
- 0 -------- 1 */
-void mdisp_join_tris(MDisps *dst, MDisps *tri1, MDisps *tri2)
-{
- int side, st;
- int S, x, y, crn;
- float face_u, face_v, crn_u, crn_v;
- float (*out)[3];
- MDisps *src;
-
- if(dst->disps)
- MEM_freeN(dst->disps);
-
- side = sqrt(tri1->totdisp / 3);
- st = (side<<1)-1;
-
- dst->totdisp = 4 * side * side;
- out = dst->disps = MEM_callocN(3*dst->totdisp*sizeof(float), "join disps");
-
- for(S = 0; S < 4; S++)
- for(y = 0; y < side; ++y)
- for(x = 0; x < side; ++x, ++out) {
- mdisp_rot_crn_to_face(S, 4, st, x, y, &face_u, &face_v);
- face_u = st - 1 - face_u;
-
- if(face_v > face_u) {
- src = tri2;
- face_u = st - 1 - face_u;
- face_v = st - 1 - face_v;
- } else src = tri1;
-
- crn = mdisp_rot_face_to_quad_crn(3, st, face_u, face_v, &crn_u, &crn_v);
-
- old_mdisps_bilinear((*out), &src->disps[crn*side*side], side, crn_u, crn_v);
- (*out)[0] = 0;
- (*out)[1] = 0;
- }
-}