View Single Post
  #1  
Old 10-10-2013, 01:51 PM
Zhi Zhi is offline
Member
 
Join Date: Mar 2011
Posts: 49
How to apply texture on an on-the-fly 3d object

This question may be naive. But I could not find the answer in the forum or from the vizard help file.

I used vizshape.addCylinder() to create an on-the-fly cylinder. Then, I used <3d_node>.texture to add a texture on it. But, the texture does not appear on the top and the bottom circular faces of the cylinder. What shall I do?

Here is my code:
Code:
	tex = viz.addTexture('wood.jpg') 
	tex.wrap(viz.WRAP_R,viz.REPEAT)
	tex.wrap(viz.WRAP_T,viz.REPEAT)
	tex.wrap(viz.WRAP_S,viz.REPEAT)

	circle = vizshape.addCylinder(height=0.15, radius=0.5)
	circle.texture(tex)
Reply With Quote