Exemplo n.º 1
0
def save_screenshot():
    rend = naali.renderer
    rend.HideCurrentWorldView()
    rend.Render()
    imgname = "image-%s.png" % time.time()
    r.takeScreenshot(SHOTPATH, imgname)
    rend.ShowCurrentWorldView()
    baseurl = "/"
    #baseurl = "http://www.playsign.fi:28080/"
    return baseurl, imgname
Exemplo n.º 2
0
 def render(self):
     timestr = datetime.datetime.today().isoformat()
     imgname = "image.png"
     r.takeScreenshot(PATH, imgname)
     
     return """
     <h1>Realxtend Naali viewer</h1>
     <h2>at %s</h2>
     <img src="%s"/>
     """ % (timestr, imgname)
Exemplo n.º 3
0
def save_screenshot():
    rend = naali.renderer
    rend.HideCurrentWorldView()
    rend.Render()
    imgname = "image-%s.png" % time.time()
    r.takeScreenshot(SHOTPATH, imgname)
    rend.ShowCurrentWorldView()
    baseurl = "/"
    #baseurl = "http://www.playsign.fi:28080/"
    return baseurl, imgname
Exemplo n.º 4
0
    def render(self):
        timestr = datetime.datetime.today().isoformat()
        imgname = "image.png"
        r.takeScreenshot(PATH, imgname)

        return """
        <h1>Realxtend Naali viewer</h1>
        <h2>at %s</h2>
        <img src="%s"/>
        """ % (timestr, imgname)
Exemplo n.º 5
0
def move(e):
    p = e.placeable
    pos = p.Position
    #oldx = pos.x()
    #newpos = (p[0] - 1, p[1], p[2])
    pos.setX(pos.x() + 1) #change the x-coordinate
    print "Moving to move to pos:", pos
    p.Position = pos

if 0:
    print "Testing taking a screenshot..."
    
    path = "pymodules/webserver/screenshot/"
    pic = "current.png"
    
    hmm = r.takeScreenshot(path, pic)
    
if 0:
    print "Testing event sending, camera for now..."#   , r.SwitchCameraState
    hmm = r.sendEvent(r.SwitchCameraState)
    print "test done?", hmm

if 0:
    print "Testing camera swap..."
    hmm = r.switchCameraState()
    #print hmm
    
if 0: #get entity
    #idnum = new_id
    idnum = naali.getCamera().id
    print "Getting entity id", idnum,
Exemplo n.º 6
0
def move(e):
    p = e.pos  #.pos - the w.i.p. api has a shortcut now that instead of a placeable with loc,rot,scale it just gives loc now directly
    oldx = p[0]  #p.x - Vector3 not wrapped (yet), just gives a tuple
    #p.x += 1 #change the x-coordinate
    newpos = (p[0] - 1, p[1], p[2])
    print "Moving to move to pos:", newpos
    e.pos = newpos


if 0:
    print "Testing taking a screenshot..."

    path = "pymodules/webserver/screenshot/"
    pic = "current.png"

    hmm = r.takeScreenshot(path, pic)

if 0:
    print "Testing event sending, camera for now..."  #   , r.SwitchCameraState
    hmm = r.sendEvent(r.SwitchCameraState)
    print "test done?", hmm

if 0:
    print "Testing camera swap..."
    hmm = r.switchCameraState()
    #print hmm

if 0:  #get entity
    #idnum = new_id
    print "Getting entity id", idnum,
    e = r.getEntity(idnum)