View Single Post
  #2  
Old 04-17-2012, 05:37 PM
masaki masaki is offline
Member
 
Join Date: Jan 2008
Posts: 63
Here is some sample code to get you started. This will create two different environments (scenes). One has the piazza and one has the dojo. The rendernode will render the dojo scene within the piazza scene.

Code:
import viz
viz.go()

#add a world
world1 = viz.add('piazza.osgb')

#add a second scene
scene2 = viz.addScene()
#add a second world and set to it the second scene
world2 = viz.add('dojo.osgb', viz.WORLD, 2)
#add a render node
renderNode = viz.addRenderNode( )
#set the scene of the render node to 2
renderNode.setScene(2)
#add a render texture at 512x512 resolution
renderTexture = viz.addRenderTexture(size=[512,512])
#attach the rendertexture
renderNode.attachTexture( renderTexture)

#add a texture quad
quad = viz.addTexQuad()
#add the rendertexture to the texturequad
quad.texture( renderTexture )
#position the texture quad
quad.setPosition(0,1,0)


viz.MainView.setPosition(0,1.8,-3)
Masaki
Reply With Quote