View Single Post
  #4  
Old 03-17-2008, 09:58 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Quote:
1) a vertical slider so that the object can be moved up and down? if so what would the code look like?
You can make a slider vertical by rotating it 90 degrees along the z-axis. Here is what the code would look like:
Code:
slider.setEuler(0,0,90)
Quote:
2) I wanted to use a live webcam as the background image. there is a tutorial that maps the webcam as a texture to a quad.
Can the live webcam image just be mapped as the "background" just like you can clear the background to a basic color, can it be "cleared" to the webcam image?
Here is some sample code showing how to have a texture show up as the background:
Code:
import viz
viz.go()

viz.add('tut_ground.wrl')


tex = viz.add('ball.jpg')

def setBackgroundTexture(tex):
	background = viz.addRenderNode()
	background.setHUD(0,100,0,100,True)
	background.setOrder(viz.PRE_RENDER)
	background.texture(tex)
	viz.MainWindow.setClearMask(viz.GL_DEPTH_BUFFER_BIT)
	
setBackgroundTexture(tex)
Reply With Quote