WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-13-2013, 10:20 AM
VirtuallyInsane VirtuallyInsane is offline
Member
 
Join Date: Jan 2013
Posts: 9
Pygame Screen within Vizard World

Hello everyone,

at the risk of asking a silly question I would like ask wether anyone knows how one could have a screen with a pygame game on within Vizard.

The same way Vizard offers the possibility to play a video file on a virtual object (e.g. 3d model of a screen) with the viz.addVideo() function, would it be possible to blit (hope that's the correct term...) a pygame animation on a screen model within a model of a virtual room? Or would there be some other way with Python using some of pygame's functions?

Best regards and many thanks!

Alvin
Reply With Quote
  #2  
Old 02-15-2013, 11:10 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
To be clear, you want to display the live output of a pygame application as a texture in Vizard?
Reply With Quote
  #3  
Old 02-16-2013, 10:48 AM
VirtuallyInsane VirtuallyInsane is offline
Member
 
Join Date: Jan 2013
Posts: 9
Hello,

thank you for your quick answer! Yes exactly! Essentially what we would like to do is to run a little experiment programmed with pygame on a 3d model of a screen in a virtual model of a room. So it would be sort of a "virtual recreation" of a normal psychological experimental setting. Would you know an existing solution to do this?

Best regards and many thanks!

Alvin
Reply With Quote
  #4  
Old 02-18-2013, 09:30 AM
Frank Verberne Frank Verberne is offline
Member
 
Join Date: Mar 2008
Location: Netherlands
Posts: 148
I needed something similar, and my solution was to have one laptop running the program I wanted to show in Vizard. On another computer, I use a webcam to film the contents of that laptop, and show the videofeed of that webcam on a texture in Vizard. See the example code below. Something similar may be a solution for you as well.

Code:
viz.go()
screen = viz.addTexQuad(size=4)
#Create Video Camera extension
video = viz.add('VideoCamera.dle')
#Connect to next available generic video capture device
cam = video.addWebcam()
#Apply videofeed of webcam as a texture of the screen
screen.texture(cam)
See (this thread: http://forum.worldviz.com/showthread.php?t=4458) for another suggestion of using VLC to capture the desktop of a computer running the pygame and stream it out via directshow.

Last edited by Frank Verberne; 02-18-2013 at 09:38 AM.
Reply With Quote
  #5  
Old 02-18-2013, 09:50 AM
VirtuallyInsane VirtuallyInsane is offline
Member
 
Join Date: Jan 2013
Posts: 9
Hello Mr Verberne,

thank you very much for your solution, this is an ingenious idea! I will definitely try to do that.

Many thanks and best regards!

Alvin
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 10:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 11:13 AM
What are the options for making a movie of a Vizard world? Karla Vizard 1 05-13-2008 10:56 AM
General Questions about Vizard: World Viz dav Vizard 5 08-28-2006 03:44 PM


All times are GMT -7. The time now is 04:48 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC