WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-22-2009, 03:04 AM
tomo_the_third tomo_the_third is offline
Member
 
Join Date: Jun 2009
Posts: 2
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
Reply With Quote
  #2  
Old 06-22-2009, 11:12 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,466
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
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
retrieve Object names Geoffrey Vizard 11 12-11-2009 04:26 AM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
rotate to object jargon Vizard 1 08-08-2005 12:20 PM
how I can get my texture to appear exactly as is defined mspusch Vizard 1 04-23-2005 12:12 PM
Move texture from one object to another Johannes Vizard 2 02-09-2005 03:55 PM


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


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