Beispiel #1
0
def main(_):
    # CONSTANTS
    num_frames_change = 2
    grid_side = 5
    obj_size = 0.7
    subdivisions = 10
    scale_factor = 0.2
    init_mat_color = (0.7, 0.1, 0.1)

    #obj_generator = lambda x,y,z:utils.icosphere_generator(obj_size, subdivisions, x, y, z)
    obj_generator = lambda x, y, z: utils.cube_generator(obj_size, x, y, z)
    #obj_updater = lambda obj,grid,idx:utils.object_updater_hide(obj, grid[idx])
    #obj_updater = lambda obj,grid,idx:utils.object_updater_scale(obj, grid[idx], scale_factor=scale_factor)
    obj_updater = lambda obj, grid, idx: utils.object_updater_color_vector(
        obj, grid[:, idx[0], idx[1]])  #check order

    utils.delete_all()
    gol = ConwayGOL_3D(grid_side,
                       utils.load_GOL_config(CONFIG_PATH, 'GOL_3D_standard'))
    obj_grid = create_grid(gol, obj_generator)
    utils.init_materials(obj_grid, init_mat_color)

    bpy.app.handlers.frame_change_pre.clear()
    bpy.app.handlers.frame_change_pre.append(lambda x: frame_handler(
        x, obj_grid, gol, obj_updater, num_frames_change))
Beispiel #2
0
def main(_):
    # CONSTANTS
    num_frames_change = 2
    grid_side = 5
    obj_size = 0.7
    subdivisions = 10
    scale_factor = 0.2

    #obj_generator = lambda x,y,z:icosphere_generator(obj_size, subdivisions, x, y, z)
    obj_generator = lambda x, y, z: utils.cube_generator(obj_size, x, y, z)
    obj_updater = lambda obj, grid, idx: utils.object_updater_hide(
        obj, grid[idx])

    utils.delete_all()
    gol = ConwayGOL_4D(grid_side)
    obj_grid = conway_3D.create_3Dgrid(gol, obj_generator)

    bpy.app.handlers.frame_change_pre.clear()
    bpy.app.handlers.frame_change_pre.append(lambda x: conway_3D.frame_handler(
        x, obj_grid, gol, obj_updater, num_frames_change))
def main(_):
    # CONSTANTS
    num_frames_change = 2
    grid_side = 5
    obj_size = 0.7
    subdivisions = 10
    scale_factor = 0.2

    #obj_generator = lambda x,y,z:icosphere_generator(obj_size, subdivisions, x, y, z)
    obj_generator = lambda x, y, z: utils.cube_generator(obj_size, x, y, z)
    obj_updater = lambda obj, grid, idx: utils.object_updater_hide(
        obj, grid[idx])
    #obj_updater = lambda obj,grid,idx:utils.object_updater_scale(obj, grid[idx], scale_factor=scale_factor)

    utils.delete_all()
    gol = ConwayGOL_3D(grid_side,
                       utils.load_GOL_config(CONFIG_PATH, 'GOL_3D_standard'),
                       seed=42)
    obj_grid = create_3Dgrid(gol, obj_generator)

    bpy.app.handlers.frame_change_pre.clear()
    bpy.app.handlers.frame_change_pre.append(lambda x: frame_handler(
        x, obj_grid, gol, obj_updater, num_frames_change))