WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-11-2005, 05:42 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Changed it and got the following exception: pointliste [[0.6171875, 0.60208332538604736], [0.7421875, 0.42916667461395264], [0.29843750596046448, 0.55833333730697632], [0.48906248807907104, 0.54583334922790527], [0.74531251192092896, 0.44374999403953552]]
Traceback (most recent call last):
File "050110_DrawPointProblem_forum.py", line 99, in mousedown
drawPoints()
File "050110_DrawPointProblem_forum.py", line 137, in drawPoints
viz.vertex(object)
File "C:\Program Files\Vizard25\viz.py", line 3692, in vertex
_ipcSend(_VIZ_VERTEX,0,0,'',x[0],x[1],x[2],0)
IndexError: list index out of range


Code:
import viz




viz.go()






RADIUS=1




viz.startlayer(viz.LINE_LOOP)


viz.vertexcolor(2, 4, 4)


viz.vertex(-RADIUS, -RADIUS, RADIUS)


viz.vertex(-RADIUS,  RADIUS, RADIUS)


line = viz.endlayer()




viz.startlayer(viz.LINE_LOOP)


viz.vertexcolor(2, 4, 4)


viz.vertex(-RADIUS, -RADIUS, RADIUS)


viz.vertex(RADIUS,  -RADIUS, RADIUS) 


line2 = viz.endlayer()


#line.translate(3,2,4)




SPIsSet,EPIsSet=0,0


startPoint=[0,0]


show=1


pointListe=[]




def mousedown(button):


	# 


	if button == viz.MOUSEBUTTON_LEFT:


		global startPoint,SPIsSet


		global endPoint,EPIsSet, pointListe


		if SPIsSet==0:


			startPoint=viz.mousepos()


			#print 'startPoint:',startPoint


			#SPIsSet=1


			pointListe.append(startPoint)


			drawPoints()


		else:


			print 'forgot option 3'


	if button == viz.MOUSEBUTTON_RIGHT:


		show=1


		drawPoints()


			

def drawPoints():


	viz.startlayer(viz.POINTS)


	viz.vertexcolor(0,12,1)


	viz.pointsize(2)


	for object in pointListe:


		print 'pointliste',pointListe


		viz.vertex(object)


	points = viz.endlayer(viz.SCREEN)
Reply With Quote
 

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


All times are GMT -7. The time now is 08:40 AM.


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