WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 01-11-2005, 03:55 PM
Johannes Johannes is offline
Member
 
Join Date: Jan 2005
Posts: 143
Yes, good and easy idea, that's what I want to do but your approach does not seem to work with this code. (Code below works but if I change the line to points = viz.endlayer(viz.SCREEN) it does not work right. The screen does not seem to actualize itself on runtime?!


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,0]
endPoint=[0,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.screentoworld(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()



	
#Create callbacks for timer events and mouse click events
viz.callback(viz.MOUSEDOWN_EVENT,mousedown)
Reply With Quote
 


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 09:08 AM.


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