Applying texture or colour to an on-the-fly object
Hello I am sorry that this must seem a very low-tech question compared to the others in this forum but I'm trying to meet a deadline and I'm getting frequently frustrated by the Vizard tutorials.
I am creating an "on-the-fly" object and need to add texture or colour to its faces. I wish to make the faces of the corner a different colour or different texture. How do I go about doing this? I include the code for my object here: #start corner RADIUS = 0.12 #topandbottom vertices viz.startlayer(viz.LINES) viz.vertexcolor(0, 0.6, 0) viz.vertex(-RADIUS, -RADIUS, -RADIUS) viz.vertex(-RADIUS, -RADIUS, RADIUS) viz.vertex(-RADIUS, -RADIUS, -RADIUS) viz.vertex( RADIUS, -RADIUS, -RADIUS) viz.startlayer(viz.LINES) viz.vertex(-RADIUS, RADIUS, -RADIUS) viz.vertex(-RADIUS, RADIUS, RADIUS) viz.vertex(-RADIUS, RADIUS, -RADIUS) viz.vertex( RADIUS, RADIUS, -RADIUS) #Sides viz.startlayer(viz.LINES) viz.vertex(-RADIUS, -RADIUS, -RADIUS) viz.vertex(-RADIUS, RADIUS, -RADIUS) viz.vertex( RADIUS, RADIUS, -RADIUS) viz.vertex( RADIUS, -RADIUS, -RADIUS) viz.startlayer(viz.LINES) viz.vertex(-RADIUS, -RADIUS, RADIUS) viz.vertex(-RADIUS, RADIUS, RADIUS) macorner = viz.endlayer() #position corner 1.5m away macorner.translate(0, 1.8, 1.5) macorner.setAxisAngle( [0, 1, 0 , -45] ) #end corner |
You could add two on-the-fly quads inside your lines as the faces you want to apply texture or color to. This page in the docs show an example of applying a texture to an on-the-fly quad.
http://www.worldviz.com/vizhelp/VizH..._and_sizes.htm |
All times are GMT -7. The time now is 02:33 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC