WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-05-2013, 05:38 AM
iva iva is offline
Member
 
Join Date: Mar 2013
Posts: 10
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?
Reply With Quote
  #2  
Old 11-05-2013, 06:44 AM
iva iva is offline
Member
 
Join Date: Mar 2013
Posts: 10
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)
I was trying to have a mini-cave inside of my scene, this is good enough
Reply With Quote
  #3  
Old 11-06-2013, 08:28 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
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
Reply With Quote
  #4  
Old 11-06-2013, 08:39 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
There are also some examples of using render nodes to render the scene to a texture in the Vizard/examples/renderNodes folder.
Reply With Quote
  #5  
Old 11-09-2013, 09:59 AM
iva iva is offline
Member
 
Join Date: Mar 2013
Posts: 10
Quote:
Originally Posted by Erikvdb View Post
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
Hm, I completely forgot that the pit has this camera-like thingy. Oh well
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
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


All times are GMT -7. The time now is 04:01 AM.


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