예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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))
예제 #6
0
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)