![]() |
|
#1
|
|||
|
|||
|
To Masaki regarding render nodes
Hello,
I am trying to render a virtual environment on a render node that is located within another virtual environment. Both worlds need to run simultaneously, one on the render node, and the other on containing the render node. How is this task accomplished? |
|
#2
|
|||
|
|||
|
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)
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to render a texture of the transparent object and then blur it | whj | Vizard | 1 | 09-25-2012 04:15 PM |
| re: render nodes and scenes | nige777 | Vizard | 2 | 10-18-2010 02:14 PM |
| How to apply shader and render texture to an object | whj | Vizard | 0 | 04-23-2010 01:23 PM |
| Internal nodes of loaded model files? | dtidrow | Vizard | 2 | 05-12-2009 09:55 AM |
| Collision with child nodes | rubberpimple | Vizard | 4 | 09-17-2008 05:27 PM |