View Single Post
  #2  
Old 05-11-2005, 05:06 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

Two problems. First, for each vertex you need to define a texture coordinate. Second, you need to add the texture before you apply it to an object. Sample code:
Code:
viz.startlayer(viz.QUADS)

#Lower left vertex
viz.texcoord(0,0)
viz.vertex(...)

#Upper left vertex
viz.texcoord(0,1)
viz.vertex(...)

#Upper right vertex
viz.texcoord(1,1)
viz.vertex(...)

#Lower right vertex
viz.texcoord(1,0)
viz.vertex(...)

plank = viz.endlayer()

plank.texture(viz.add('wood.gif'))
Reply With Quote