diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-07-25 12:48:58 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-07-25 12:48:58 +0400 |
commit | 48c9da843c40ff8a97b462d8539185b662ba1567 (patch) | |
tree | 5ef66e3398e8a8b852e405cd29ba26ce3f617404 /object_grease_scatter.py | |
parent | 7690c2a38db02317d7ad289a16b8c55b5ec0ed3a (diff) |
swap vector multiplication order, also some style changes
Diffstat (limited to 'object_grease_scatter.py')
-rw-r--r-- | object_grease_scatter.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/object_grease_scatter.py b/object_grease_scatter.py index 2557f043..139ca7a8 100644 --- a/object_grease_scatter.py +++ b/object_grease_scatter.py @@ -182,7 +182,7 @@ def _main(self, DENSITY=1.0, SCALE=0.6, RAND_LOC=0.8, RAND_ALIGN=0.75): m_alt_2 = Matrix.Rotation(radians(-22.5), 3, n) for _m in mats: for m in (_m, m_alt_1 * _m, m_alt_2 * _m): - hit, nor, ind = ray(pofs, pofs + (n_seek * m)) + hit, nor, ind = ray(pofs, pofs + (m * n_seek)) if ind != -1: dist = (pofs - hit).length if dist < best_dist: @@ -320,13 +320,13 @@ def _main(self, DENSITY=1.0, SCALE=0.6, RAND_LOC=0.8, RAND_ALIGN=0.75): # make 2 angles and blend angle = radians(uniform(-180, 180.0)) - angle_aligned = -(ori.angle(Vector((0.0, 1.0, 0.0)) * quat, radians(180.0))) + angle_aligned = -(ori.angle(quat * Vector((0.0, 1.0, 0.0)), radians(180.0))) quat = Quaternion(no, (angle * (1.0 - RAND_ALIGN)) + (angle_aligned * RAND_ALIGN)).cross(quat) f = uniform(0.1, 1.2) * SCALE - coords.append([co + ((tri[0] * f) * quat), co + ((tri[1] * f) * quat), co + ((tri[2] * f) * quat)]) + coords.append([co + (quat * (tri[0] * f)), co + (quat * (tri[1] * f)), co + (quat * (tri[2] * f))]) # face_ind.append([i*3, i*3+1, i*3+2]) apply_faces(coords) |