WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-01-2012, 10:21 PM
goro goro is offline
Member
 
Join Date: May 2012
Posts: 33
Smile

No need to use stencil function. We just have to use mask.disable(viz.COLOR_WRITE) this command will not display the object but it'll still write to depth. So the object behind this invisible object will get affected. Don't forget to set mask.drawOrder(-1).

Code:
Code:
import viz
viz.setOption('viz.display.stencil',1)
viz.go()

piazza = viz.addChild('piazza.osgb')

logo1 = viz.addChild('logo.ive')
logo1.setPosition(0.3,1,5)

logo2 = viz.addChild('logo.ive')
logo2.setPosition(-0.3,1,3)

mask = viz.addChild('logo.ive')
mask.setPosition(0,1,4)

mask.disable(viz.COLOR_WRITE)
mask.drawOrder(-1)


Now don't worry about the black mask. if you set the environment scene i.e. piazza draw order lower than mask draw order then piazza will get rendered before mask.

add this line to the previous code
Code:
piazza.drawOrder(-2)
and you'll get the desired output
Reply With Quote
Reply

Tags
clipping, hiding, mask, stencil


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
return variable from keypress function starbug Vizard 2 01-07-2010 11:14 AM
Documentating function names aaThomas Vizard 5 05-15-2007 09:50 AM
Do you know how to send a value for 'pool' to the onActionEnd function? ghazanfar Vizard 1 03-22-2007 10:25 AM
timers and director function Jerry Vizard 1 06-22-2006 09:47 AM


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


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