示例#1
0
def test_engine2windows():

    eng = Engine()
    eng.run()
    # create a world
    w = World(0)

    # create default camera
    cam = DefaultCamera()

    # add camera
    w.add(cam)

    # create image viewr
    a = np.random.random((100, 100, 100))
    aff = np.eye(4)
    cds = ConnectedSlices(aff, a)

    # add cds to world
    w.add(cds)

    # add world to engine
    eng.add(w)

    # create a window
    wi = FosWindow()

    # attach window to world
    wi.attach(w)

    wi2 = FosWindow()
    # attach window to world
    wi2.attach(w)
示例#2
0
def test_engine2windows():
    
    eng = Engine()
    eng.run()
    # create a world
    w = World(0)
    
    # create default camera
    cam = DefaultCamera()
    
    # add camera
    w.add(cam)
    
    # create image viewr
    a=np.random.random( ( 100, 100, 100) )
    aff = np.eye(4)
    cds = ConnectedSlices(aff,a)
    
    # add cds to world
    w.add(cds)
    
    # add world to engine
    eng.add(w)
    
    # create a window
    wi = FosWindow()
    
    # attach window to world
    wi.attach(w)
    
    wi2 = FosWindow()
    # attach window to world
    wi2.attach(w)
示例#3
0
文件: engine.py 项目: fos/fos-legacy
    def add(self, world):
        self.worlds.append(world)

    def update(self, dt):
        print "dt", dt
        # this should call the update of all the actors
        # in a world

    def stop(self):
        self.running = False


if __name__ == "__main__":

    #    eng = Engine()
    #    eng.run()

    # create a world
    w = World(0)

    # create default camera
    cam = DefaultCamera()

    # add camera
    w.add(cam)

    # create a window
    # attach window to world
    wi = FosWindow(bgcolor=color.orange)
    wi.attach(w)
示例#4
0
    def add(self, world):
        self.worlds.append(world)
                
    def update(self, dt):
        print "dt", dt    
        # this should call the update of all the actors
        # in a world
        
    def stop(self):
        self.running = False

if __name__ == '__main__':
    
#    eng = Engine()
#    eng.run()
    
    # create a world
    w = World(0)    
    
    # create default camera
    cam = DefaultCamera()
    
    # add camera
    w.add(cam)    
   
    # create a window
    # attach window to world
    wi = FosWindow(bgcolor=color.orange)
    wi.attach(w)

示例#5
0
import numpy as np

from fos.core.world import World
from fos.core.fos_window import FosWindow
from fos.core.camera import DefaultCamera
from fos.actor.volslicer import ConnectedSlices
from fos.actor.triangle import Triangle
from fos.actor.network import AttributeNetwork

w = World(0)
cam = DefaultCamera()
w.add(cam)

tri = Triangle()
w.add(tri)

wi = FosWindow()
wi.attach(w)