#1
|
|||
|
|||
Using current scene as a texture?
I don't know how to exactly explain what am I trying to do. I want to have a screen somewhere in the Vizard scene that is showing the scene from a certain viewpoint. I know how to do it in different windows, but windows are parented to screen, and I would like, somehow, to have them parented to the world, which doesn't really work. Does anybody have any ideas?
|
#2
|
|||
|
|||
Okay, I cannot edit my message, but I solved the problem and here is my code:
Code:
import viz viz.go() view=viz.MainView viz.MainView.setPosition(-1.5,2.5,-6) viz.MainView.setEuler(0,10,0) viz.fov(70) scene=viz.add("piazza.osgb") WALL_SCALE = [1.6, 1.87, 1] wall = viz.addTexQuad(size=1.87) wall.setPosition( [-2, 0, 0] ) wall.zoffset(1) #avoid zfighing, make wall appear behind pictures wall.setScale( WALL_SCALE ) wallL = viz.addTexQuad(size=1.87) wallL.setPosition( [-3.5, 0, -1.5] ) wallL.setEuler(-90,0,0) wallL.zoffset(1) #avoid zfighing, make wall appear behind pictures wallL.setScale( WALL_SCALE ) wallR = viz.addTexQuad(size=1.87) wallR.setPosition( [-0.5, 0, -1.5] ) wallR.setEuler(90,0,0) wallR.zoffset(1) #avoid zfighing, make wall appear behind pictures wallR.setScale( WALL_SCALE ) male = viz.add('vcc_male.cfg') male.setPosition([-2, 0,-1.5]) male.state(9) logo = viz.add('logo.ive',pos=(0,3,6)) logo.addAction(vizact.spin(0,1,0,45)) logo.scale(0.5, 0.5, 0.5) # Create render texture tex = viz.addRenderTexture() texL = viz.addRenderTexture() texR = viz.addRenderTexture() # middle cave wall cam = viz.addRenderNode() cam.setSize(512,512) cam.setInheritView(False) cam.setPosition([0.0, 2.0, 0]) cam.lookAt([0,2,33]) cam.setFov(60,1.0,0.1,100) cam.setRenderTexture(tex) cam.setRenderLimit(viz.RENDER_LIMIT_FRAME) wall.texture(tex) # left cave wall camL = viz.addRenderNode() camL.setSize(512,512) camL.setInheritView(False) camL.setPosition([0, 2.0, 0]) #camL.setEuler([-90,0,0]) camL.lookAt([-19,2,11]) camL.setFov(60,1.0,0.1,100) camL.setRenderTexture(texL) camL.setRenderLimit(viz.RENDER_LIMIT_FRAME) wallL.texture(texL) # right cave wall camR = viz.addRenderNode() camR.setSize(512,512) camR.setInheritView(False) camR.setPosition([0.0, 2, 0]) camR.lookAt([19,2,11]) camR.setFov(60,1.0,0.1,100) camR.setRenderTexture(texR) camR.setRenderLimit(viz.RENDER_LIMIT_FRAME) wallR.texture(texR) |
#3
|
|||
|
|||
For future reference you can always look at the 'The Pit' world demo, as well as the mirror script that's in the Worldviz Knowledge Base
|
#4
|
|||
|
|||
There are also some examples of using render nodes to render the scene to a texture in the Vizard/examples/renderNodes folder.
|
#5
|
|||
|
|||
Hm, I completely forgot that the pit has this camera-like thingy. Oh well
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Texture Coordinate Generation (TexGen) using Shader | goro | Vizard | 1 | 05-31-2013 01:44 AM |
How to render a texture of the transparent object and then blur it | whj | Vizard | 1 | 09-25-2012 03:15 PM |
Avatar texture swaping | sleiN13 | Vizard | 5 | 06-24-2011 12:48 AM |
How to apply shader and render texture to an object | whj | Vizard | 0 | 04-23-2010 12:23 PM |
Copying Scene? | Brett Lindberg | Vizard | 0 | 08-28-2009 11:56 PM |