[Bf-blender-cvs] [ef78283d] fracture_modifier: fix attempt for getting better fractal details, using bbox center and a smaller fractal plane now
Martin Felke
noreply at git.blender.org
Mon Dec 12 22:11:55 CET 2016
Commit: ef78283dd39c74870acd9868c46533a69e1d9df2
Author: Martin Felke
Date: Mon Dec 12 22:11:27 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rBef78283dd39c74870acd9868c46533a69e1d9df2
fix attempt for getting better fractal details, using bbox center and a smaller fractal plane now
===================================================================
M source/blender/blenkernel/intern/fracture.c
M source/blender/blenkernel/intern/fracture_util.c
===================================================================
diff --git a/source/blender/blenkernel/intern/fracture.c b/source/blender/blenkernel/intern/fracture.c
index 4ec04af..0958a89 100644
--- a/source/blender/blenkernel/intern/fracture.c
+++ b/source/blender/blenkernel/intern/fracture.c
@@ -572,13 +572,11 @@ static void handle_boolean_fractal(Shard* p, Shard* t, int expected_shards, Deri
float matrix[4][4];
/*make a plane as cutter*/
- BKE_object_dimensions_get(obj, size);
- radius = MAX3(size[0], size[1], size[2]);
-
- /*loc[0] = (BLI_frand() - 0.5f) * size[0];
- loc[1] = (BLI_frand() - 0.5f) * size[1];
- loc[2] = (BLI_frand() - 0.5f) * size[2];*/
- copy_v3_v3(loc, p->centroid);
+ //BKE_object_dimensions_get(obj, size);
+ shard_boundbox(p, loc, size);
+ //radius = MAX3(size[0], size[1], size[2]);
+ radius = sqrt(size[0]*size[0] + size[1]*size[1] + size[2]*size[2]);
+ //copy_v3_v3(loc, p->centroid);
eul[0] = BLI_frand() * M_PI;
eul[1] = BLI_frand() * M_PI;
diff --git a/source/blender/blenkernel/intern/fracture_util.c b/source/blender/blenkernel/intern/fracture_util.c
index 3aeb6c6..32ac5a4 100644
--- a/source/blender/blenkernel/intern/fracture_util.c
+++ b/source/blender/blenkernel/intern/fracture_util.c
@@ -418,7 +418,7 @@ static DerivedMesh* do_fractal(float radius, float mat[4][4], bool use_smooth_in
bm = BM_mesh_create(&bm_mesh_allocsize_default, &((struct BMeshCreateParams){.use_toolflags = true,}));
BMO_op_callf(bm, (BMO_FLAG_DEFAULTS & ~BMO_FLAG_RESPECT_HIDE),
"create_grid x_segments=%i y_segments=%i size=%f matrix=%m4",
- 1, 1, radius*1.4f, mat);
+ 1, 1, radius, mat);
/*subdivide the plane fractally*/
for (i = 0; i < num_levels; i++)
More information about the Bf-blender-cvs
mailing list