WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-16-2017, 09:14 PM
Vishav Vishav is offline
Member
 
Join Date: Jun 2017
Posts: 54
Keep texture in foreground using addTexquad command

Dear all,

As shown in my attached jpeg file I want texture map to come in front of infoBox (i.e. in the foreground) but it is coming in the background. How do i can solve it? I am attaching my source code for the same. Please help in it.

Source Code:

apple_i= viz.add( 'D:\PhD\Study-I_Part_I\Textures\Apple.jpg')
mapPos = [0.5,0.4,1.5]
mapScale = [1.5,1.5,1.5]
apple_i= viz.add( 'D:\PhD\Study-I_Part_I\Textures\Apple.jpg')
map = viz.addTexQuad(viz.SCREEN, align = viz.TEXT_LEFT_CENTER, pos=mapPos, scale =mapScale)
map.texture(apple_i)
infoBox = vizinfo.InfoPanel('What object i am interested in?',fontSize=12,window=viz.MainWindow,margin=
(15.0,15.0),icon=False,align=viz.ALIGN_CENTER)
infoBox.setTitle( 'Question 1' )
Ball= infoBox.addLabelItem('', viz.addRadioButton('color'))
infoBox.addSeparator(padding=(100,100))
Apple = infoBox.addLabelItem('', viz.addRadioButton('color'))
submitButton=infoBox.addItem(viz.addButtonLabel('S ubmit'),align=viz.ALIGN_CENTER)
yield viztask.waitButtonUp(submitButton)
Attached Thumbnails
Click image for larger version

Name:	Snapshots.jpg
Views:	109
Size:	14.8 KB
ID:	960  
Reply With Quote
  #2  
Old 11-17-2017, 04:41 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,448
To force the texture quad over the info panel, set the quad's draw order to a higher number. Here's an example:

Code:
'''
Press 1 to set quad above
Press 2 to set quad below
'''

import viz
import vizinfo
import vizact

viz.go()

quad = viz.addTexQuad(parent=viz.ORTHO, scale=[100]*3)
quad.texture(viz.addTexture('lake3.jpg'))
quad.alignment(viz.ALIGN_CENTER_CENTER) 
viz.link(viz.CenterCenter, quad) 

info = vizinfo.InfoPanel(title='This is a vizinfo panel', align=viz.ALIGN_CENTER_CENTER,icon=False)

def setQuadAbove():
	quad.drawOrder(10)
	
def setQuadBelow():
	quad.drawOrder(-10)
	
vizact.onkeydown('1',setQuadAbove)
vizact.onkeydown('2',setQuadBelow)
Reply With Quote
  #3  
Old 11-17-2017, 05:37 AM
Vishav Vishav is offline
Member
 
Join Date: Jun 2017
Posts: 54
Thanks a lot Jeff! It is working
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
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM


All times are GMT -7. The time now is 10:33 AM.


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