View Single Post
  #2  
Old 03-23-2012, 02:57 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use a render node to render the scene to a texture and then apply that texture to any object in the world. Here is a simple example:
Code:
import viz
import vizact
viz.go()

# Add environment
gallery = viz.add('gallery.osgb')

# Add spinning logo
logo = viz.add('logo.ive',pos=(0,0,4))
logo.addAction(vizact.spin(0,1,0,45))

# Create render texture
tex = viz.addRenderTexture()

# Create render node
cam = viz.addRenderNode()
cam.setSize(512,512)
cam.setInheritView(False)
cam.setPosition([0.0, 5.87440, 9.62242])
cam.lookAt([0,1,4])
cam.setFov(60,1.0,0.1,100)
cam.setRenderTexture(tex)
cam.setRenderLimit(viz.RENDER_LIMIT_FRAME)

# Apply render texture to gallery painting
gallery.texture(tex,node='painting_starry-night')
Reply With Quote