def step_impl_ray_element_vector(context, item, element, x, y, z): assert (item in context.dict.keys()) assert (element in valid_ray_elements) ray = context.dict[str(item)] thing = eval("ray." + str(element)) vec4_value = vector(float(x), float(y), float(z)) assert (equal(thing, vec4_value))
def step_get_obj_normal_at_point(context, item, xnum, xdenom, ynum, ydenom, znum, zdenom): assert (item in context.tuple.keys()) value = context.tuple[str(item)] new_vector = vector( np.sqrt(float(xnum)) / float(xdenom), np.sqrt(float(ynum)) / float(ydenom), np.sqrt(float(znum)) / float(zdenom)) assert (equal(value, new_vector))
def step_group_when_point_is_world_to_object(context, p, s, xnum, xdenom, ynum, ydenom, znum, zdenom): assert (s in context.dict.keys()) ensure_context_has_tuple(context) context.tuple[str(p)] = normal_to_world( context.dict[str(s)], vector( np.float32(np.sqrt(float(xnum))) / np.float32(xdenom), np.float32(np.sqrt(float(ynum))) / np.float32(ydenom), np.float32(np.sqrt(float(znum))) / np.float32(zdenom)))
def step_cylinder_given_local_normal_is_vector(context, nml, x, y, z): ensure_context_has_tuple(context) context.tuple[str(nml)] = vector(np.float32(x), np.float32(y), np.float32(z)).normalize()
def step_then_variable_equals_vector_value(context, item_n, x, y, z): assert (item_n in context.tuple.keys()) local_vector = context.tuple[str(item_n)] test_vector = vector(float(x), float(y), float(z)) assert (equal(local_vector, test_vector))
def step_cube_local_normal_is_vector(context, nml, x, y, z): assert (nml in context.tuple.keys()) cube_normal = context.tuple[str(nml)] test_vector = vector(np.float32(x), np.float32(y), np.float32(z)) assert (equal(cube_normal, test_vector))
def step_impl_vector_assign_E(context, item, x, ynum, ydenom, znum, zdenom): ensure_context_has_tuple(context) context.tuple[item] = vector( np.float32(x), -np.sqrt(np.float32(ynum)) / np.float32(ydenom), -np.sqrt(np.float32(znum)) / np.float32(zdenom))
def step_impl_vector_assign_D(context, item, x, y, z): ensure_context_has_tuple(context) context.tuple[item] = vector(np.float32(x), np.float32(y), np.float32(z))
def step_impl_generic_ray_full(context, item, px, py, pz, vx, vy, vz): pt = point(np.float32(px), np.float32(py), np.float32(pz)) vc = vector(np.float32(vx), np.float32(vy), np.float32(vz)) ensure_context_has_dict(context) context.dict[str(item)] = ray(pt, vc)
def step_impl_vector_assign_C(context, item, x, y, z): ensure_context_has_tuple(context) context.tuple[item] = vector(float(x), float(y), -float(z))
def step_impl_vector_assign_B(context, item, x, ynum, ydenom, znum, zdenom): ensure_context_has_tuple(context) context.tuple[item] = vector(float(x), np.sqrt(float(ynum)) / float(ydenom), -np.sqrt(float(znum)) / float(zdenom))