Changeset 1644

Show
Ignore:
Timestamp:
02/25/10 13:12:08 (5 months ago)
Author:
mturk
Message:

Adding option to specify x_vec and y_vec

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/yt-1.6/yt/extensions/volume_rendering/software_sampler.py

    r1618 r1644  
    3131                    partitioned_grids = None, field = 'Density', 
    3232                    log_field = True, whole_box=False, 
    33                     nsamples = 5): 
     33                    nsamples = 5, x_vec = None, y_vec = None): 
    3434    center = na.array(center, dtype='float64') 
    3535 
    3636    # This just helps us keep track of stuff, and it's cheap 
    3737    cp = pf.h.cutting(L, center) 
     38    if x_vec is None: x_vec = cp._x_vec 
     39    if y_vec is None: y_vec = cp._y_vec 
    3840    back_center = center - cp._norm_vec * na.sqrt(3) * W 
    3941    front_center = center + cp._norm_vec * na.sqrt(3) *  W 
     
    7779 
    7880    vp = VectorPlane(vectors, norm_vec, back_center, 
    79                      (xp0, xp1, yp0, yp1), image, cp._x_vec, cp._y_vec) 
     81                     (xp0, xp1, yp0, yp1), image, x_vec, y_vec) 
    8082 
    81     tf.light_dir = cp._norm_vec + 0.5 * cp._x_vec + 0.5 * cp._y_vec 
     83    tf.light_dir = cp._norm_vec + 0.5 * x_vec + 0.5 * y_vec 
    8284    cx, cy, cz = 0.3, -0.3, 0.3 
    8385    tf.light_dir = (cp._inv_mat[0,0]*cx + cp._inv_mat[0,1]*cy + cz, 
  • trunk/yt/extensions/volume_rendering/software_sampler.py

    r1629 r1644  
    3131                    partitioned_grids = None, field = 'Density', 
    3232                    log_field = True, whole_box=False, 
    33                     nsamples = 5): 
     33                    nsamples = 5, x_vec = None, y_vec = None): 
    3434    center = na.array(center, dtype='float64') 
    3535 
    3636    # This just helps us keep track of stuff, and it's cheap 
    3737    cp = pf.h.cutting(L, center) 
     38    if x_vec is None: x_vec = cp._x_vec 
     39    if y_vec is None: y_vec = cp._y_vec 
    3840    back_center = center - cp._norm_vec * na.sqrt(3) * W 
    3941    front_center = center + cp._norm_vec * na.sqrt(3) *  W 
     
    7779 
    7880    vp = VectorPlane(vectors, norm_vec, back_center, 
    79                      (xp0, xp1, yp0, yp1), image, cp._x_vec, cp._y_vec) 
     81                     (xp0, xp1, yp0, yp1), image, x_vec, y_vec) 
    8082 
    81     tf.light_dir = cp._norm_vec + 0.5 * cp._x_vec + 0.5 * cp._y_vec 
     83    tf.light_dir = cp._norm_vec + 0.5 * x_vec + 0.5 * y_vec 
    8284    cx, cy, cz = 0.3, -0.3, 0.3 
    8385    tf.light_dir = (cp._inv_mat[0,0]*cx + cp._inv_mat[0,1]*cy + cz,