WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-10-2012, 05:12 PM
surf3rguy surf3rguy is offline
Member
 
Join Date: Jan 2012
Posts: 5
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?
Reply With Quote
  #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
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
How to render a texture of the transparent object and then blur it whj Vizard 1 09-25-2012 03:15 PM
re: render nodes and scenes nige777 Vizard 2 10-18-2010 01:14 PM
How to apply shader and render texture to an object whj Vizard 0 04-23-2010 12:23 PM
Internal nodes of loaded model files? dtidrow Vizard 2 05-12-2009 08:55 AM
Collision with child nodes rubberpimple Vizard 4 09-17-2008 04:27 PM


All times are GMT -7. The time now is 08:09 AM.


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