Пример #1
0
class myscene(dragonfly.pandahive.spyderframe):
    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    #First panda
    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model", "egg", [("walk", "models/panda-walk4", "egg")], a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    #Second panda
    a = Spyder.AxisSystem()
    a *= 0.002
    pandaclass2 = Spyder.ActorClass3D("models/panda-model", "egg", [("walk", "models/panda-walk4", "egg")], a,
                                      actorclassname="pandaclass2")

    box = Spyder.Box2D(200, 500, 48, 48)
    icon2 = Spyder.Icon("pandaicon.png", "pandaicon2", box, transparency=True)

    #Third panda
    a = Spyder.AxisSystem()
    a *= 0.3
    model = Spyder.Model3D("models/panda", "egg", a)
    pandaclass3 = Spyder.EntityClass3D("pandaclass3", [model])

    box = Spyder.Box2D(280, 480, 144, 112)
    icon3 = Spyder.Icon("pandaicon2.png", "pandaicon3", box, transparency=True)

    camcenter = Spyder.Entity3D(
        "camcenter",
        (
            Spyder.NewMaterial("white", color=(255, 255, 255)),
            Spyder.Block3D((1, 1, 1), material="white"),
        )
    )

    marker = Spyder.Entity3D(
        "marker",
        (
            Spyder.NewMaterial("blue", color=(0, 0, 255)),
            Spyder.Circle(2, origin=(0, 0, 0.1), material="blue")
        )
    )

    del a, box, model
Пример #2
0
class myscene(dragonfly.pandahive.spyderframe):
    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model",
                             "egg", [("walk", "models/panda-walk4", "egg")],
                             a,
                             entityname="mypanda")

    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model",
                                     "egg",
                                     [("walk", "models/panda-walk4", "egg")],
                                     a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    del a, box
Пример #3
0
class myscene(myspyderframe):
    scene = bee.parameter("bee")
    canvas = bee.parameter("bee")
    mousearea = bee.parameter("bee")

    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model", "egg", [("walk", "models/panda-walk4", "egg")], a,
                             entityname="mypanda")

    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model", "egg", [("walk", "models/panda-walk4", "egg")], a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    m1 = Spyder.NewMaterial("red", (255, 0, 0))
    m2 = Spyder.NewMaterial("green", (0, 255, 0))
    m3 = Spyder.NewMaterial("blue", (0, 0, 255))
    m_ax = Spyder.AxisSystem(origin=(5, -3, 0))
    m_ax2 = Spyder.AxisSystem(origin=(-5, -3, 3))
    m_ax2.rotateZ(30)
    m_ax2.rotateX(-60)

    del a, box
Пример #4
0
class myscene(dragonfly.pandahive.spyderframe):
    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model",
                             "egg", [("walk", "models/panda-walk4", "egg")],
                             a,
                             entityname="mypanda")

    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model",
                                     "egg",
                                     [("walk", "models/panda-walk4", "egg")],
                                     a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    camcenter = Spyder.Entity3D("camcenter", (
        Spyder.NewMaterial("white", color=(255, 255, 255)),
        Spyder.Block3D((1, 1, 1), material="white"),
    ))

    del a, box
Пример #5
0
    class pandascenehive(dragonfly.pandahive.spyderframe):
        for name in pandadict:
            mode, data, box, image = pandadict[name]
            model, modelformat, animations, a = data
            if mode == "actor":
                obj = Spyder.ActorClass3D(model,
                                          modelformat,
                                          animations,
                                          a,
                                          actorclassname=name)
            elif mode == "model":
                model = Spyder.Model3D(model, modelformat, a)
                obj = Spyder.EntityClass3D(name, [model])
            else:
                raise ValueError(mode)
            locals()[name + "_obj"] = obj

            im, transp = image
            locals()[name + "_icon"] = Spyder.Icon(im,
                                                   name,
                                                   box,
                                                   transparency=transp)

        del name
        del model, modelformat, animations, a, obj
        del mode, data, box, image
        del im, transp
Пример #6
0
class myscene(dragonfly.pandahive.spyderframe):
    pandaicon_ = bee.get_parameter("pandaicon")

    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model",
                             "egg", [("walk", "models/panda-walk4", "egg")],
                             a,
                             entityname="mypanda")

    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model",
                                     "egg",
                                     [("walk", "models/panda-walk4", "egg")],
                                     a,
                                     actorclassname="pandaclass")

    box = box2d(50, 470, 96, 96)
    params = parameters()
    params.transparency = True
    args = canvasargs("pandaicon.png", pandaicon_, box, params)
    plugin = plugin_single_required(args)
    pattern = ("canvas", "draw", "init", ("object", "image"))
    d1 = dummydrone(plugindict={pattern: plugin})

    i1 = bee.init("mousearea")
    i1.register(pandaicon_, box)

    del a, box, params, args, plugin, pattern
Пример #7
0
class myscene(dragonfly.pandahive.spyderframe):
    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model",
                             "egg", [("walk", "models/panda-walk4", "egg")],
                             a,
                             entityname="mypanda")

    ##First panda class
    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model",
                                     "egg",
                                     [("walk", "models/panda-walk4", "egg")],
                                     a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    #Second panda class
    a = Spyder.AxisSystem()
    a *= 0.002
    pandaclass2 = Spyder.ActorClass3D("models/panda-model",
                                      "egg",
                                      [("walk", "models/panda-walk4", "egg")],
                                      a,
                                      actorclassname="pandaclass2")

    box = Spyder.Box2D(200, 500, 48, 48)
    icon2 = Spyder.Icon("pandaicon.png", "pandaicon2", box, transparency=True)

    #Third panda class
    a = Spyder.AxisSystem()
    a *= 0.3
    model = Spyder.Model3D("models/panda", "egg", a)
    pandaclass3 = Spyder.EntityClass3D("pandaclass3", [model])

    box = Spyder.Box2D(280, 480, 144, 112)
    icon3 = Spyder.Icon("pandaicon2.png", "pandaicon3", box, transparency=True)

    del a, box, model
Пример #8
0
    class pandasceneframe(dragonfly.pandahive.spyderframe):
        mode, data, box, image, hivemap = panda
        model, modelformat, animations, a = data
        if mode == "actor":
            obj = Spyder.ActorClass3D(model, modelformat, animations, a, actorclassname=name)
        elif mode == "model":
            model = Spyder.Model3D(model, modelformat, a)
            obj = Spyder.EntityClass3D(name, [model])
        else:
            raise ValueError(mode)

        im, transp = image
        icon = Spyder.Icon(im, name, box, transparency=transp)

        del model, modelformat, animations, a
        del mode, data, box, image, hivemap
        del im, transp
Пример #9
0
class myscene(myspyderframe):
    a = Spyder.AxisSystem()
    a *= 0.25
    a.origin += (-8, 42, 0)
    env = Spyder.Model3D("models/environment", "egg", a)

    a = Spyder.AxisSystem()
    a *= 0.005
    mypanda = Spyder.Actor3D("models/panda-model",
                             "egg", [("walk", "models/panda-walk4", "egg")],
                             a,
                             entityname="mypanda")

    a = Spyder.AxisSystem()
    a *= 0.005
    pandaclass = Spyder.ActorClass3D("models/panda-model",
                                     "egg",
                                     [("walk", "models/panda-walk4", "egg")],
                                     a,
                                     actorclassname="pandaclass")

    box = Spyder.Box2D(50, 470, 96, 96)
    icon = Spyder.Icon("pandaicon.png", "pandaicon", box, transparency=True)

    m1 = Spyder.NewMaterial("red", (255, 0, 0))
    m2 = Spyder.NewMaterial("green", (0, 255, 0))
    m3 = Spyder.NewMaterial("blue", (0, 0, 255))
    m4 = Spyder.NewMaterial("white", (255, 255, 255))
    m_ax = Spyder.AxisSystem(origin=(5, -3, 0))
    m_ax2 = Spyder.AxisSystem(origin=(-5, -3, 3))
    m_ax2.rotateZ(30)
    m_ax2.rotateX(-60)

    m = Spyder.World3D(materials=[m1, m2, m3, m4], objects=[m_ax, m_ax2])
    m.tofile("m.web")

    del m
    del a, box
Пример #10
0
#Third panda class
a = Spyder.AxisSystem()
a *= 0.3
data = "models/panda", "egg", [], a
box = Spyder.Box2D(280, 480, 144, 112)
image = "pandaicon2.png", True
hivemap = "pandajump.web"
pandadict["pandaclass3"] = ("model", data, box, image, hivemap)

#Build the Spyder file from the dict
mps = Spyder.MovingPandaArray()
for name in sorted(pandadict.keys()):
    mode, data, box, image, hivemap = pandadict[name]
    model, modelformat, animations, a = data
    if mode == "actor":
        obj = Spyder.ActorClass3D(model, modelformat, animations, a, actorclassname=name)
    elif mode == "model":
        model = Spyder.Model3D(model, modelformat, a)
        obj = Spyder.EntityClass3D(name, [model])
    else:
        raise ValueError(mode)

    mp = Spyder.MovingPanda(
        name,
        hivemap,
        mode,
        [obj],
        image[0],
        box,
        image[1],
    )