WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 07-09-2009, 12:25 PM
jsnider jsnider is offline
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
pic = viz.addTexture('tex.jpg')
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?
Reply With Quote
Old 07-09-2009, 01: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:
import viz
import vizshape

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

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

#Apply first texture to front/back face

#Apply second texture to left/right face
Reply With Quote
Old 07-09-2009, 03:17 PM
jsnider jsnider is offline
Join Date: Jul 2009
Posts: 9
Thank you. That worked perfect.
Reply With Quote

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 04:21 PM
Translating a texture and its Alpha shivanangel Vizard 5 12-02-2008 05:52 PM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 01:14 PM
3D Texture Mapping in Vizard? stefs Vizard 2 03-25-2008 04:34 AM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 01:12 PM

All times are GMT -7. The time now is 09:55 AM.

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