def createBasicAnimation(sceneName, type, index_name): objC = oc.ObjectCreator() rot = list(rng.randint(0, 360, 3)) objC.addRectPrism([0.0, 0.0, 0.0], [1.5, 1.5, 1.5], [1, 0, 0], rot) xyz = getxyz(10) objC.addPointLight(xyz, [1, 1, 1]) dict = {"objects": {"light": {"position": xyz}}, "name": sceneName} sceneFromObjCreator(sceneName, objC, dict, type, index_name)
def sphereScene(sceneName, type, index_name): objC = oc.ObjectCreator() objC.addSphere([0.0, 0.0, 0.0], 2, [1, 0, 0]) for i in range(3): xyz = getxyz(10) objC.addPointLight(xyz, [1, 1, 1]) dict = {"class": 0, "name": sceneName} sceneFromObjCreator(sceneName, objC, dict, type, index_name)
def cubeScene(sceneName, type, index_name): objC = oc.ObjectCreator() objC.addRectPrism([0.0, 0.0, 0.0], [1.5, 1.5, 1.5], [1, 0, 0]) for i in range(3): xyz = getxyz(10) objC.addPointLight(xyz, [1, 1, 1]) dict = {"class": 1, "name": sceneName} sceneFromObjCreator(sceneName, objC, dict, type, index_name)
def ltlDebugScene(sceneName, type, index_name): objC = oc.ObjectCreator() objC.addSphere([0.0, 0.0, 0.0], 2, [1, 0, 0]) xyz = np.zeros(3) for index, element in enumerate(xyz): xyz[index] = rng.randn(1) * 10 objC.addPointLight(xyz, [1, 1, 1]) dict = {"objects": {"light": {"position": xyz}}, "name": sceneName} sceneFromObjCreator(sceneName, objC, dict, type, index_name)
def secondAnimation(sceneName, type, index_name): objC = oc.ObjectCreator() rot = list(rng.randint(0, 360, 3)) color = getRandColor() objC.addRectPrism([0.0, 0.0, 0.0], [1.5, 1.5, 1.5], color, rot) xyz = getxyz(10) objC.addPointLight(xyz, [1, 1, 1]) dict = { "objects": [{ "light": { "position": xyz } }, { "rect": { "color": color, "color_class": get_color_class(color) } }], "name": sceneName } sceneFromObjCreator(sceneName, objC, dict, type, index_name, get_color_class(color))
def fourth_animation(scene_name, type, index_name): objC = oc.ObjectCreator() rot = list(rng.randint(0, 360, 3)) color = getRandColor() size = rng.random_sample(1)[0] * 1.5 + 1 objC.addCone([0.0, 0.0, 0.0], [1, 1, 1], color, rot) xyz = getxyz(10) objC.addPointLight(xyz, [1, 1, 1]) dict = { "objects": [{ "light": { "position": xyz } }, { "rect": { "color": color, "color_class": get_color_class(color), "size": size } }], "name": scene_name } sceneFromObjCreator(scene_name, objC, dict, type, index_name)