WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 07-09-2009, 11:25 AM
jsnider jsnider is offline
Member
 
Join Date: Jul 2009
Posts: 9
one side texture

I want to put a target on one side of a box. It seems that textures would work the best. I tried
Code:
target=viz.add('box.wrl')
pic = viz.addTexture('tex.jpg')
target.texture(pic)
where tex.jpg is a 256x256 image of a bullseye, but it puts the texture on all sides (as I assume it should). Is there anyway around that or a different approach that would work better?
Thanks,
Joe
Reply With Quote
  #2  
Old 07-09-2009, 12:52 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
You can use the undocumented vizshape module to create a box with each face split into a separate sub-node, allowing you to apply a different texture. Here is some sample code:
Code:
import viz
import vizshape
viz.go()

#Create box with each face split into separate sub-node
box = vizshape.addBox([1,1,1],splitFaces=True,pos=(0,1.8,4))
box.addAction(vizact.spin(0,1,0,45))

#Create textures
t1 = viz.add('image1.jpg')
t2 = viz.add('image2.jpg')

#Apply first texture to front/back face
box.texture(t1,node='front')
box.texture(t1,node='back')

#Apply second texture to left/right face
box.texture(t2,node='left')
box.texture(t2,node='right')
Reply With Quote
  #3  
Old 07-09-2009, 02:17 PM
jsnider jsnider is offline
Member
 
Join Date: Jul 2009
Posts: 9
Thank you. That worked perfect.
Joe
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
displayHTML and side by side stereo hosier Vizard 4 08-28-2009 03:21 PM
Translating a texture and its Alpha shivanangel Vizard 5 12-02-2008 04:52 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
3D Texture Mapping in Vizard? stefs Vizard 2 03-25-2008 03:34 AM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 12:12 PM


All times are GMT -7. The time now is 08:06 PM.


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