WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
  #1  
Old 12-09-2008, 10:48 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Can you post a working script that reproduces this specific problem? I tried the following script and it works for me. It loads 2 OTF nodes underneath a group node. When the spacebar is pressed, it will set the color of the group node to red, which gets applied to the OTF nodes.
Code:
import vizshape
viz.go()

group = viz.addGroup(pos=(0,1,10))

box = vizshape.addBox(parent=group,color=viz.BLUE,pos=(-1,0,0))
sphere = vizshape.addSphere(parent=group,color=viz.GREEN,pos=(1,0,0))

vizact.onkeydown(' ',group.color,viz.RED)
Reply With Quote
  #2  
Old 12-09-2008, 11:53 AM
michaelrepucci michaelrepucci is offline
Member
 
Join Date: Jul 2008
Posts: 53
Interesting ... I wish I'd known about vizshape, because I've basically recreated much of its functionality, and in an apparently inferior way. I can't seem to find any documentation on vizshape, and its code comments are rather sparse as well. What you sent me does work.

Here's an example of what I did (a bit stripped down but reproduces the error):

Code:
import viz
import math

class Circle(viz.VizPrimitive):
	def __init__(self):
		#draw circle
		viz.startlayer(viz.LINE_LOOP)
		for i in range(32):
			radians = 2*math.pi*i/32
			viz.vertex([math.sin(radians),math.cos(radians),0])
		self.node = viz.endlayer()
		
		#initialize base class
		viz.VizPrimitive.__init__(self,self.node.id)

class Probe(viz.VizPrimitive):
	def __init__(self):
		#draw probe
		self.node = viz.addGroup()
		
		#draw circle
		circle = Circle()
		circle.parent(self.node)
		
		#draw lines
		viz.startlayer(viz.LINES)
		viz.vertex(0,0,0)
		viz.vertex(0,0,-1)
		line = viz.endlayer(self.node)
		
		#initialize base class
		viz.VizPrimitive.__init__(self,self.node.id)
	
viz.go()
viz.eyeheight(0)

probe = Probe()
probe.setPosition(0,0,5)
probe.setEuler(20,10,0)
probe.color(viz.RED)
probe.lineWidth(10)
Here you will notice the probe shows up with wide lines, but in white, not red.
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
Pivot points for child objects in Vizard with 3ds Max Gladsomebeast Vizard 0 09-19-2006 11:21 AM


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


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